apexcharts / apexcharts.js

📊 Interactive JavaScript Charts built on SVG
https://apexcharts.com
MIT License
14.34k stars 1.3k forks source link

Apexcharts management of series #44

Closed arkhenstone closed 6 years ago

arkhenstone commented 6 years ago

Feels like something is wrong with the way Apexcharts remember the state of the chart (at least for line type).

I use one instance of apexcharts, where depending the category the user choose from a select input, the js asynchronously fetch for data, and inject series and config into apexcharts.

This works but it break quite some functionnalities :

FIrst the zoom is broken (since the latest version of apexcharts it seems), whatever zoom tool takes the axis ranges from the default data shown at first render.

Also the reset zoom reinject default series.

Maybe I missed something in the docs ?

See the gif :

deepin-screen-recorder_select area_20180821090851

junedchhipa commented 6 years ago

I think this is related to the issue #38 The zooming options keep the initial state in memory, but when updating data, it seems the new data is not reflected. I am working on this, thanks for reporting

junedchhipa commented 6 years ago

I just tested the updateOptions() method with a different set of timeseries and it seems like for me zooming works as expected. Can I see what options are you updating in updateOptions() method?

junedchhipa commented 6 years ago

Also, I would suggest trying with the latest build v1.3.9

arkhenstone commented 6 years ago

Still doesn't work. I use the vue wrapper, so I'm just setting the series variable. Maybe the problem is with the vue-wrapper then.

junedchhipa commented 6 years ago

Yeah, maybe. I will update the vue wrapper's dependency and test updating the series with a large difference in the x-axis values.

junedchhipa commented 6 years ago

@arkhenstone Please try the latest release 1.4.10 - I have done major changes to the management of series. Tested a lot of use cases similar to what you have described.