We have multiple charts with zoom. Is there a way to link all this charts so they always have the same zoom factor when the user zoom in one of the charts?
问问题
2645 次
1 回答
3
当不可能在同一个图表中有多个网格时,我使用这个技巧来完成这项工作:
myChart.on('datazoom', function (evt) {
var zoom = myChart.getOption().dataZoom[0];
myOtherChart.dispatchAction({
type: 'dataZoom',
dataZoomIndex: 0,
startValue: zoom.startValue,
endValue: zoom.endValue
});
});
两个图表都有 dataZoom,在我的例子中,我将一个隐藏在 myOtherChart 中。
于 2019-10-25T12:52:37.077 回答