Please copy this into input on the left side.
option = {
title: {
text: 'ECharts 入门示例'
},
tooltip: {},
legend: {
data:['销量']
},
xAxis: {
data: ["衬衫","羊毛衫","雪纺衫","裤子","高跟鞋","袜子"]
},
yAxis: {},
series: [{
name: '销量',
type: 'bar',
data: [5, 20, 36, 10, 10, 20]
}],
toolbox: {
feature: {
restore: {
title: 'Restore',
},
dataZoom: {
title: {
zoom: 'Zoom',
back: 'Back',
clear: 'Back',
},
restore: {
title: 'Restore',
},
},
},
},
dataZoom: [
{
type: 'inside',
show: true,
zoomOnMouseWheel: false,
moveOnMouseMove: false,
},
]
};
myChart.on('dataZoom', function (params) {
console.log(params);
// should return percentage values, but returns undefined
console.log(params.batch[0].start);
console.log(params.batch[0].end);
});
myChart.on('dataZoom', function (params) {
console.log(params);
// should return percentage values, but returns undefined
console.log(params.batch[0].start);
console.log(params.batch[0].end);
});
I thought, the dataZoom event (triggered after zooming the graph using the toolbox buttons) would return start and end values in percent
start and end (percents) returns undefined. Values are not included in the payload of an event.
Version
4.1.0-release
Reproduction link
https://ecomfe.github.io/echarts-examples/public/editor.html?c=doc-example/getting-started
Steps to reproduce
Please copy this into input on the left side.
// please copy this :)
then try to zoom graph, and then have a look into console
What is expected?
I thought, the dataZoom event (triggered after zooming the graph using the toolbox buttons) would return start and end values in percent
What is actually happening?
start and end (percents) returns undefined. Values are not included in the payload of an event.
Thank you :)