react-apexcharts
react-apexcharts copied to clipboard
Synced charts not updating correctly
Hi all! I have an issue while updating series and options of syncing charts. You can check the behavior on this sandbox.
https://codesandbox.io/s/dawn-grass-ylt02?fontsize=14&hidenavigation=1&theme=dark
Try changing the top select and notice that charts have the same title and the sync is not working properly.
I see the title updates in all the charts. Can you please make a minimal example? Without all the extra overhead updating just series and chart title?
At first the titles are Factor 1 and Factor 2. When you select another value in the dropdown, titles become Factor 2 and Factor 2 and stay like this for any subsequent udpate. However, the tooltips contain the correct chart title.
Hi I have the same issue. I just made simple example here for you. Very similar to your Demo example of Syncing charts. Thanks.
I think this is all related to this bug #182 where options are overwritten.
Hi cstrat. Thanks for your comment. I do not understand your solution. I do not see any way to change Syncing Charts options instead passing it as an options prop to ReactApexChart component. And I think that we can all agree that Syncing Charts component has some bug when comparing states of previous options with new ones. It is obvious that any change on just one of Syncing Charts options overrides options on all charts in Syncing Charts group. Fortunately, only initial options when Syncing Charts component is mounted for the first time are applied correctly. I made one workaround. Rerendering Syncing Charts like they are mounted for the first time every time if any of options are changed. ☹ You can check my workaround here where I forked my previous example in which I presented problem in simple way for contributors of this nice repo.