react-apexcharts icon indicating copy to clipboard operation
react-apexcharts copied to clipboard

Synced charts not updating correctly

Open orestiskosko opened this issue 5 years ago • 5 comments

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.

orestiskosko avatar Mar 08 '20 13:03 orestiskosko

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?

junedchhipa avatar Mar 10 '20 15:03 junedchhipa

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.

orestiskosko avatar Mar 10 '20 20:03 orestiskosko

Hi I have the same issue. I just made simple example here for you. Very similar to your Demo example of Syncing charts. Thanks.

Vezilic avatar Mar 14 '21 21:03 Vezilic

I think this is all related to this bug #182 where options are overwritten.

cstrat avatar Apr 19 '21 00:04 cstrat

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.

Vezilic avatar Apr 22 '21 20:04 Vezilic