datazoom event not detected from roam mousewheel or toolbox
See original GitHub issueVersion
4.3.0
Reproduction link
https://www.echartsjs.com/examples/en/editor.html?c=graph
Steps to reproduce
- Edit example code to be this (adding datazoom event listener at very bottom):
myChart.showLoading();
$.get(ROOT_PATH 'data/asset/data/les-miserables.gexf', function (xml) {
myChart.hideLoading();
var graph = echarts.dataTool.gexf.parse(xml);
var categories = [];
for (var i = 0; i < 9; i ) {
categories[i] = {
name: '类目' i
};
}
graph.nodes.forEach(function (node) {
node.itemStyle = null;
node.value = node.symbolSize;
node.symbolSize /= 1.5;
node.label = {
normal: {
show: node.symbolSize > 30
}
};
node.category = node.attributes.modularity_class;
});
option = {
title: {
text: 'Les Miserables',
subtext: 'Default layout',
top: 'bottom',
left: 'right'
},
tooltip: {},
legend: [{
// selectedMode: 'single',
data: categories.map(function (a) {
return a.name;
})
}],
animationDuration: 1500,
animationEasingUpdate: 'quinticInOut',
series : [
{
name: 'Les Miserables',
type: 'graph',
layout: 'none',
data: graph.nodes,
links: graph.links,
categories: categories,
roam: true,
focusNodeAdjacency: true,
itemStyle: {
normal: {
borderColor: '#fff',
borderWidth: 1,
shadowBlur: 10,
shadowColor: 'rgba(0, 0, 0, 0.3)'
}
},
label: {
position: 'right',
formatter: '{b}'
},
lineStyle: {
color: 'source',
curveness: 0.3
},
emphasis: {
lineStyle: {
width: 10
}
}
}
]
};
myChart.setOption(option);
// Add this to sample
myChart.on('datazoom', function(e) {
console.log('zoom');
});
// End add this
}, 'xml');
-
Zoom with mouse action (or add toolbox zoom controls and zoom that way).
-
No zoom event is detected.
What is expected?
A zoom event is detected.
What is actually happening?
Nothing.
Options from my own similar project:
setup.options = {
title: {
top: 'bottom',
left: 'right'
},
animation: false,
tooltip: {
trigger: 'item',
position: 'right',
confine: true,
backgroundColor: 'transparent',
padding: [40, 0, 0, 0],
enterable: false,
formatter: function(item) {
return 'Click for more';
}
},
series : [
{
name: '###',
type: 'graph',
layout: 'force',
force: {
repulsion: 95,
gravity: 0.015,
edgeLength: 40,
layoutAnimation: false
},
roam: true,
draggable: true,
data: setup.nodes,
links: setup.links,
focusNodeAdjacency: true,
itemStyle: {
normal: {
borderColor: '#fff',
borderWidth: 1,
shadowBlur: 10,
shadowColor: 'rgba(0, 0, 0, 0.3)'
}
},
lineStyle: {
color: 'source',
curveness: 0.3
},
emphasis: {
lineStyle: {
width: 10
}
}
}
]
};
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
datazoom event not detected from roam mousewheel or toolbox
Edit example code to be this (adding datazoom event listener at very bottom):. myChart.showLoading(); $.get(ROOT_PATH 'data/asset/data/les- ...
Read more >echarts 4.3.0 datazoom event not detected - Stack Overflow
I'm not able to detect the datazoom event when for a chart with series type graph, with roam enabled. This is for eCharts...
Read more >Data zoom with mouse wheel does not work. - Nevron Software
I checked the "Wheel Zoom" check box in the "Data Zoom Tool" of the sample provided by your company and tried to operate...
Read more >org.apache.echarts.commits - 2019 October - 1251 messages
[GitHub] [incubator-echarts] amygroshek edited a comment on issue #11361: datazoom event not detected from roam mousewheel or toolbox - GitBox.
Read more >Changelog - Apache ECharts
[Fix] Fix sometimes when using "toolbox dataZoom" it can not return to the original state. Fix #11055. [Fix] Fix the texture pattern rendering...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sorry, I made a mistake to take
option.dataZoom
into consideration just now. According to the code, maybe you can use:Hope it helps you!
@yufeng04
graphRoam
works! Thank you! I can’t get zoom start and end, but I am able to detect the event and see whether it’s zoom in or out.