public JsonResult BarChartIndexYearly() { var ongoing = _dataSheetService.DataSheetCountYearly(); List <BarData> barDatas = new List <BarData>(); foreach (var item in ongoing.OrderBy(k => k.Month).OrderBy(k => k.Year)) { barDatas.Add(new BarData { Name = item.Description, Data = item.Average }); } BarChart barChart = new BarChart { FillColor = "rgba(173,166,20,1)", StrokeColor = "rgba(220,220,220,0.8)", HighlightFill = "rgba(220,220,220,0.75)", HighlightStroke = "rgba(220,220,220,1)", Datas = barDatas }; return(Json(barChart)); }