[Feature] Allow callback functions to access the scale extents #20035
Labels
en
This issue is in English
new-feature
pending
We are not sure about whether this is a bug/new feature.
waiting-for: author
What problem does this feature solve?
I'm working on an OHLC/Candlestick chart, and it looks like I need to use the category axis to avoid the gaps. I wanted to implement a custom xAxis tick and labeler so that the ticks are demarcated, not based on random dates/times produced by the no label overlap algo, but on major logical points like start of the month, start of the year, start of the hour, etc like these:
For me to implement a sophisticated labeler / ticker function, I need to know what is the current data that's show in the chart. There's no API for this as far as I know, and I had to resort to a hack like this:
I did try the datazoomEvent, but the labeler / ticker function fires first, so I can't use it.
What does the proposed API look like?
I'm proposing to add an extra object parameter in the callback function of axisTick.interval and axisLabel.interval that includes information that helps in creating sophisticated ticker / labelers:
Same goes for axisLabel.formatter:
The
params
Object will include information that would let us derive which span of data is currently shown.The text was updated successfully, but these errors were encountered: