question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature] How to get the axis range when datazoom scales it?

See original GitHub issue

What problem does this feature solve?

Hopefully the axis range could be known when it’s changed. I have y-axis scale set to true, and enabled datazoom. When I zoom or pan the chart, clearly the y-axis’s range changes too. Now I need to know the new range. I tried to listen to datazoom event but it doesn’t look like any properties in the option could give me the values.

chart.on("datazoom", params => console.log(chart.getOption().yAxis[0]))

From the output I cannot see any information showing the y-axis range. Is there a way I can get it?

What does the proposed API look like?

Add a range property in the yAxis option:

yAxis: {
    range: [currentMin: number, currentMax: number]
}

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
plainheartcommented, Nov 26, 2022

@bbcfive This API is not exposed, so you have to use as any or // @ts-ignore to disable the TS check.

0reactions
bbcfivecommented, Nov 26, 2022

hi @plainheart, but how can I solve the ts error?

Property ‘getModel’ is private and only accessible within class ‘ECharts’.ts(2341)

Read more comments on GitHub >

github_iconTop Results From Across the Web

DataZoom Slider Does Not Respect Y Axis min if positive value
If y axis has a min and/or max set, the data zoom should adhere and have the same range as the chart's y...
Read more >
Range and scale on visual types in QuickSight
By default, the axis range starts at 0 and ends with the highest value for the measure being displayed. For the group-by axis,...
Read more >
Apache Echarts: dataZoom's miniature misrepresents data in ...
By default, dataZoom doesn't take into account the chart scale limits ticks or/and the minimum and maximum allowable values (range of a function...
Read more >
Axis - Concepts - Handbook - Apache ECharts
Both x-axis and y-axis included axis line, tick, label and title. Some chart will use the grid to assist the data viewing and...
Read more >
Charts configure - pyecharts
The display interval of the x-axis scale labels is valid in the category axis. By default, labels are displayed with intervals that do...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found