echarts icon indicating copy to clipboard operation
echarts copied to clipboard

[Feature] Request to add events that are called before running datazoom.

Open kim1124 opened this issue 2 years ago • 2 comments

What problem does this feature solve?

It would be nice to add an event that can determine whether to run datazoom before running datazoom. As shown in the screenshot below, if the start and end ranges of datazoom are the same, the meaning of datazoom is lost, so I want to block it.

onedata_zoom jpeg

It will be easier to control if you decide whether to run datazoom based on the return value of the event. It will also help improve usability by allowing you to define tasks that need to be processed before data zooming occurs.

What does the proposed API look like?

echarts.on('beforeDataZoom', (params) => {
  // Set the parameters equal to those of the datazoom handler.
  const _startIdx = params.batch[0].startValue
  const _endIdx = params.batch[0].endValue

  // Run datazoom if the return value is true, and do not run datazoom if false.
  return _startIdx < _endIdx
})

kim1124 avatar Dec 04 '23 08:12 kim1124

Zoom attributes are available at any time, no need for events - Demo Code. 📌 please close issue if problem solved.

helgasoft avatar Dec 10 '23 00:12 helgasoft

This issue has been automatically marked as stale because it did not have recent activity. It will be closed in 7 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this issue.

github-actions[bot] avatar Dec 09 '25 21:12 github-actions[bot]

This issue has been automatically closed because it did not have recent activity. If this remains to be a problem with the latest version of Apache ECharts, please open a new issue and link this to it. Thanks!

github-actions[bot] avatar Dec 16 '25 21:12 github-actions[bot]