Q: How to make a chart in asp.net mvc 5 How to make a chart in ASP.NET so that I can display data from database using the chart. Any body can explain me? Thank you.

A: @{ 
var db = Database.Open("SmallBakery"); 
var dbdata = db.Query("SELECT Name, Price FROM Product"); 
var myChart = new Chart(width: 600, height: 400) 
   .AddTitle("Product Sales") 
   .DataBindTable(dataSource: dbdata, xField: "Name")
   .Write();
}

Source
