echarts: dataZoom click not working

Version

5.2.1

Reproduction link

https://jsfiddle.net/tmtron/9y0xtqs7/11/

Steps to reproduce

click on the dataZoom

What is expected?

click event should be invoked

What is actually happening?

click event is not invoked


The example from the documentation: echartsInstance. on is also not working:

chart.on('click', 'dataZoom', function () {...});
  • Other click events work: e.g. on the series, axis-labels (when triggerEvent is set to true)
  • but for dataZoom, triggerEvent does not exist
  • Maybe someone knows a temporary workaround?

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 16 (10 by maintainers)

Most upvoted comments

Sorry for not merging the PR from @susiwen8 . Didn’t notice it’s a mistake from the doc.

We need to think through these questions carefully before we providing such an event.

  1. Which part of the dataZoom can trigger the event. The whole component or only the slider. If it’s only the slider, what about other parts of the dataZoom.
  2. What event parameters we need to provide. And how developers can use them in their scenarios.
  3. How should we handle the conflicts of loading action from click event handler and the default dataZoom action.
  4. Is there a better way to do async loading on demand. For example, render a loading button around the slider, this button will trigger click event with necessary event parameters.