public JsonResult BarChartIndex() { var ongoing = _dataSheetService.DataSheetCountMonty(); 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.Count }); } BarChart barChart = new BarChart { FillColor = "rgba(10,122,128,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)); }