Emmmanuel FIADUFE

Emmmanuel FIADUFE

  • 791
  • 1.1k
  • 52.1k

Plotting sales data on a graph

Nov 3 2023 1:28 PM

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);
}

 


Answers (3)