Welcome to the JavaScript feedback portal. We’re happy you’re here! If you have feedback on how to improve the JavaScript, we’d love to hear it!

  • Check out the features or bugs others have reported and vote on your favorites. Feedback will be prioritized based on popularity.
  • If you have feedback that’s not listed yet, submit your own.

Thanks for joining our community and helping improve Syncfusion products!

0
Votes

Firstly - this is a bug against AccumulationChart rather than Chart, but AccumulationChart isn't available from the "Control" drop down list on this form!

Anyway while reporting a bug with HeatMap not allocating element ids where the target element was missing an id I noticed that while Chart and AccumulationChart both allocate ids when missing they have slightly different code, and in fact the way that AccumulationChart does it is not safe.
AccumulationChart just queries the DOM for all current accumulation charts on the page and then allocates an id based on the count found. This means if you were to create 3 charts against elements with no id, delete the first chart's element and then create another chart you would allocate an id that's already in use which will cause the svg to vanish from an existing chart.

I've also noticed another weirdness with the id allocation in that it uses a private property of "chartid" in creating the element id which has a hardcoded initial value however that hardcoded initial value isn't  actually set by the time the the id allocation code runs anyway so you end up with "undefined" in the ids.

Anyway, I have create an example here of the collision issue. This creates 3 charts against elements without ids and shows the id allocated to them, then after a timer of 3 seconds it destroys the first chart (and resets the id and class on the element the chart was created) and recreates the first chart. As you can see it reallocates the id which had been allocated to the third chart and the svg vanishes from the third chart.

The way the Chart control allocates element ids looks to be safe as it actually iterates to find an id not currently in use so I think the fix is for AccumulationChart to use the same technique (and get rid of or fix that weird use of the undefined this.chartid property!)