Hi Andrea,
Thanks for using Syncfusion products.
We have analyzed your code snippet and the screenshot and we suggest you to remove the point collection before updating the series.
In your code snippet,
option method was used to update the chart. The
option method of chart extends the existing object with new values. For example, if we use
option method to update a point in series, it will only update the specified point so other points and options like series type, marker, tooltip, etc will not be modified.
Since August and October months have 31 days and September has 30 days, only first 30 points in series will be updated and the last(31
st) point will not be removed when changing data from October to September or August to September. To avoid this we need to remove the unnecessary point in series collection before updating.
Please refer the following code snippet to achieve this
[JS] //Create an instance of chart var chartObj = $("#container").ejChart("instance"); for (var i = 0; i < chartObj.model.series.length; i++) //Empty the point collection in each series before updating chartObj.model.series[i].points = []; //Update the chart with new points $("#container").ejChart("option", {series: updatedSeries});
|
We have prepared a simple sample for your requirement and it can be downloaded from the following link
Dynamic update We can also update the chart using
redraw method. The following KB article provides more information about redraw method
https://www.syncfusion.com/kb/3275/how-to-use-the-redraw-method-of-chart Note:
Option method is a shorthand to update multiple options in Chart without instance. In
redraw method, we should create an instance and update the options individually.
Please let us know if you have any concern.
Regards,
Anandaraj