Hello Team,
In my MVC C# application I want to plot bar graph on my dashboard from sales table, kindly help.
public JsonResult GetSalesPerformance()
{
ASPNETMASTERPOSTEntities db = new ASPNETMASTERPOSTEntities();
var previousYear = (DateTime.Now.Year - 1);
var sales = db.tblSales.ToList();
var salesByMonthAmount = (from a in sales
// Your LINQ query here
);
return Json(salesByMonthAmount, JsonRequestBehavior.AllowGet);
}
Vishal JoshiPosted Nov 5, 2023, 6:22 AM
Hello Emmanuel,
Please try the below LINQ query to get sales data by month to plot on the chart.
Thanks
Vishal Joshi
Emmmanuel FIADUFEPosted Nov 5, 2023, 10:58 AM
Thank you Vishal, it is working perfectly
Sam HobbsPosted Nov 3, 2023, 8:35 PM
Have you looked in Nuget for chart libraries?