how to set dynamic data in highcharts how to set dynamic data in highcharts json json

how to set dynamic data in highcharts


Your data is a String, it needs to be an array of array, where the inner array consists of two elements, the first being the key as string, and 2nd the value in numeric form.

success : function(data) {   var chartData=[];   $.each(data.jsonArray, function(index)    {     $.each(data.jsonArray[index],       function(key,value) {       var point = [];       point.push(key);       point.push(value);       chartData.push(point);                                });   });   chart.series[0].setData(chartData); }


You can prepare your data first, like in the @Jugal Thakkar answer above, and then use update function available from v5.

chart.update({    series: preparedSeriesData});

this will dynamically update the chart.