How to avoid all chart component re-rendering of chart on calling setOption to update graphics element
One-line summary [问题简述]
I am calling to setOption to only show/hide graphics element of type image but doing this causes hole chart re-render can we avoid this somehow in echart.
Version & Environment [版本及环境]
- ECharts version [ECharts 版本]:
- Browser version [浏览器类型和版本]:
- OS Version [操作系统类型和版本]:
myChart.setOption({
graphic: {
id: 'image1',
left: left,
top: top,
invisible: false,
silent: false
}
}, false, false, true);
myChart.setOption({
graphic: {
id: 'image1',
invisible: true,
silent: true
}
}, false, false, true);
Expected behaviour [期望结果]
ECharts option [ECharts配置项]
myChart.setOption({
graphic: {
id: 'image1',
left: left,
top: top,
invisible: false,
silent: false
}
}, false, false, true);
Other comments [其他信息]
setOption takes three parameters at most, (option: Object, notMerge?: boolean, lazyUpdate?: boolean). If notMerge is set to be false, it will only update the changed part.
Thanks for reply. I agree with you, if notMerge is set to be false, it will only update the changed part but it re-render whole chart which I want to avoid. In my case, I have render scatter plot which large amount of data and later I just call setOption to show/hide graphics element of type image on some event, But each time I call setOption, it re-render whole chart which I want to avoid in this case. Is their any way to do this.
In that case, you need to set z of some part to be a different value, so that it will be in a different canvas. And updates will only happen in that canvas.
Hi Ovilia, You mean I should set higher z value for graphics element which I am going to show/hide. Please correct me if I am wrong with example.
I mean you should put those often change into a different z, so that when you show/hide or change them, the rest will not be re-draw.