so i have a small application, that registers how many clicks are on certain statements.
I have a table called ClickStatistics Which stores the ID for the specific statement clicked, and a Datetime "LogDate".
I want to create a graph that tells me how many clicks there has been each week.
I have made something similar with months, but i am unable to figure out a way to do it for weeks.
var months = new[]{
"Januar",
"Februar",
"Marts",
"April",
"Maj",
"Juni",
"Juli",
"August",
"September",
"Oktober",
"November",
"December"
};
var MonthlyCountQuery = from c in ClickStatistics
where c.LogDate.Year == selectedYear && c.Statement.Deleted == false
group c by c.LogDate.Month into grp
select new
{
Month = grp.Key,
Clicks = grp.Count(),
};
var monthlyCount = MonthlyCountQuery.ToList().Select(i => new { Month = months[i.Month - 1], i.Clicks});
Any tips would be welcome!