Hi Goran,
Greetings from Syncfusion.
We have analyzed your query. We would like to let you know that if you need to change the data source, then you no need to call the refresh method of chart. Once the data source is bind as depicted below, the chart will be refreshed automatically.
We have prepared a sample in which using the button click event we have updated the data source of chart. Find the code snippet below.
|
[index.html]
<input type="button" value="Update Series" id="update" />
[index.js]
document.getElementById("update").onclick = function (){
//Get the data source
//...
//Get the instance of chart
var chart = document.getElementById("line-container").ej2_instances[0];
//Bind the data soruce
chart.series[0].dataSource = updatedData;
}
|
Screenshot:
Before updating data source:
After updating data source:
Sample for reference can be find below.
Thanks,
Dharani.