You must be logged in to post your query.
Home › Forums › Chart Support › React – error happen when zoom
Hi, sometime when I zoom the line chart or try to toggleDataSeries (hide 1 of the serial data), it will have this error
“Cannot read property ‘appendChild’ of null” from /canvasjs.min.js
But sometime it work fine. This things happen randomly… How to solve it?
I know the reason that cause this error. Because I render multiple line chart and sync zoom, so I need to push the ref (onRef) to an array for sync zoom behavior.
Then I have a refresh button for user to refresh the chart and re-render the chart, but I forget to clear the array before re-render so the array size become larger and mix with previous ref.
Therefore I try to clear the array before call the API to retrieve the data and re-render the chart, but I found that the onRef is not trigger. It will only trigger when first time render the chart. Why?
Can you kindly create a sample StackBlitz reproducing the issue you are facing and share it with us so that we can understand the scenario better and help you out?
Hi, thank for your reply. That issue already solve, it due to my own mistaken. I am very sorry.
Glad that you have figured it out :)
You must be logged in to reply to this topic. Login/Register