echarts icon indicating copy to clipboard operation
echarts copied to clipboard

[Feature] 用户拖动dataZoom不触发数据窗口变化

Open jj-lu opened this issue 2 years ago • 3 comments

What problem does this feature solve?

用户拖动dataZoom的时候禁止触发默认改变数据窗口的事件,让开发者自己获取dataZoom的触发事件修改图表应该显示的数据

What does the proposed API look like?

dataZoom提供一个属性关闭默认事件,或者监听datazoom事件时return false 可以阻止默认事件

jj-lu avatar Jul 19 '23 07:07 jj-lu

@jj-lu It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people and get helped, we'd like to suggest using English next time. 🤗

TRANSLATED

TITLE

[Feature] User dragging dataZoom does not trigger data window change

BODY

What problem does this feature solve?

When the user drags the dataZoom, it is forbidden to trigger the event of changing the data window by default, so that developers can get the trigger event of dataZoom to modify the data that the chart should display

What does the proposed API look like?

dataZoom provides a property to close the default event, or return false when listening to the datazoom event can prevent the default event

echarts-bot[bot] avatar Jul 19 '23 07:07 echarts-bot[bot]

我很需要这个功能,请问你还有别的什么方法吗,不然只能在图表下面加一个额外的不关联图表的选择器了

komorebi-cqd avatar Feb 23 '24 10:02 komorebi-cqd

我尝试直接throw一个错误,发现可以阻止事件冒泡

  /** 阻止底部被拖拽 */
            myChart.on('datazoom', function () {
                throw new Error('主动上报一个错误'); 
            });

mcfly001 avatar Apr 15 '24 11:04 mcfly001