Apexcharts.js: Reset changes zoom, but does not fire zoomed

Created on 29 Oct 2018  路  3Comments  路  Source: apexcharts/apexcharts.js

Codepen

codepen

Explanation

When you zoom in, or out using the buttons, the zoomed event fires. However when you use the reset button no event fires, yet the zoom is changed.

This makes it impossible to track the zoom.

e.g. I have a timeseries showing hits on a website. I want that when the user zooms in it tells me a total of all the hits in that time period, so I hook the zoomed event and filter the data for that period to create the total.

But without zoomed firing on a reset (or without a reset() hook) I can't reset the total, so my total will be incorrect.

Most helpful comment

Calling zoomed on reset zoom makes sense. I will fire the zoomed event in reset also.

All 3 comments

OK, so looks like I can use updated and check for ctx.globals.zoomed === false, but I think it would still be sensible to fire zoomed when the zoom changes.

Calling zoomed on reset zoom makes sense. I will fire the zoomed event in reset also.

Thanks! Great library.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

georgehardy picture georgehardy  路  3Comments

drummad picture drummad  路  3Comments

felixalguzman picture felixalguzman  路  3Comments

frlinw picture frlinw  路  3Comments

ismaildervisoglu picture ismaildervisoglu  路  3Comments