Home › Forums › Chart Support › Dynamic chart from SQL Server in MVC › Reply To: Dynamic chart from SQL Server in MVC
@arqu07,
The issue is in updateChart function. It fails to enter for-loop as value of x (var x = i;) is same as the value of result.length. Read data from database, store it in another variable (lets say result1) and then push that to dataPoints as shown below.
var x = i;
var updateChart = function () { for(var y=0; y < result1.length; y++){ dataPoints.push({label:result1[y].Date, y:result1[y].Value2}); } x=y; chart.render(); };
Please check this updated project
— Vishwas R