You must be logged in to post your query.
Home › Forums › Chart Support › Data stops updating (for apparently no reason)
Tagged: data series, update
Hi, I’m using the area chart, and I’m having problem with updating the chart.
The data that feeds the chart can be changed by the user, so the chart should update according to user’s input. It all works fine until one specific function “clearThis()” is called. This function replaces the points inside the array holding the data (called ‘load1’) by [{x:0, y:0}], erasing the previous data. After that, it seems like the chart loses its capacity to read the data array (load1), and the chart stops updating. I don’t see why, and I can’t find the error.
My code in under this folder https://www.dropbox.com/sh/v4h1kbuc7mf2bze/AAAt3lahanImAUzHSobuhaeva?dl=0
I appreciate any help! Thanks
@eu-mesma,
Within clearThis(), you are trying to assign dataPoints to dataSeries. Updating it properly should work fine in this case i.e. Replacing chart1.data = load1; with chart1.options.data[0].dataPoints = load1; should work fine. Here is the working code of the same.
clearThis()
chart1.data = load1;
chart1.options.data[0].dataPoints = load1;
— Vishwas R Team CanvasJS
I missed that! thank you very much!! you guys are the best <3
You must be logged in to reply to this topic. Login/Register