Open jeffrey-roosendaal opened 7 years ago
A pending bug from 5 years ago in high priority, and it is still not fixed ...
@marccompte Please see my comment above
I tried that but did not work. I'm trying other chart libraries now.
@marccompte I have struggled with the same issue, replaceMerge
works as you'd expect. Try this:
chart.setOption(options, {
replaceMerge: ["series", "yAxis", "xAxis", "grid"],
});
I solved this for React and only set "notMerge" to true.
<ReactECharts option={options} opts={{ renderer: 'svg' }} notMerge={true} />
This help for me <3
I felt some cases above might relate to this issue https://github.com/apache/echarts/issues/14192 , where the seettings of components like axis need passed to setOption() to trigger relevant graph redraw correctlly. I was using 5.3.2 and that issue still exists.
Is there any news for this issue. Recently I got issue that cannot change the symbolSize of the lines series. Not sure that relates to this issue. Here is an example
for someone who may meet this problem, you may have wrapped a component like this:
useEffect(() => {
if (!chartInstanceRef.current) return;
chartInstanceRef.current?.setOption(option, { notMerge: true }); // set notMerge true
}, [options])
the problem is still present when I try to switch the expandAndCollapse state in the tree viewer from true to false, it continues expanding and collapsing the tree, although it shouldn't so the setOption still doesn't work properly can you please look at this problem and try to fix it? would be really grateful!
Yeah, I’m still experiencing this problem.
Moreover, in my case optional parameter notMerge
wasn’t helpful at all.
Therefore, It would be really nice to have this bug fixed.
Thank you for time and effort in advance!
Are there any updates?
Tengo el mismo problema, lo resolví configurando la serie
data = null
que no quieres. También puedes probarlo.setOption(option, true)
Thanks, I have this problem with echart 5.4.4 too
Using notMerge
with echarts-for-react
can help, but it can also has unexpected effects - e.g. selection tools do not work. Despite echarts-for-react
does not support the replaceMerge
yet, You can still use custom effect and call it Yourself, e.g.:
useEffect(() => {
if (!chartRef.current) {
return
}
// @ts-ignore
const chart = chartRef.current.getEchartsInstance()
if (!chart) {
return
}
chart.setOption(option, {
replaceMerge: ['series'],
})
}, [chartRef, ...])
When updating the charts through
echartsInstance.setOption()
, the series are not always correctly updated/drawn.For example, when I initialize the chart (custom made funnel, but this happens with every chart type) with 3 series, it may look like this:
It shows 3 series, which all display correctly. Now, when I create a new chart object with 6 series, and overwrite my current chart, it changes (and animates) to:
This, also, looks good. The problem is when updating again, to a chart with less series then the current chart. See what happens when I update the chart to 3 series:
It draws the 3 new series over the first old 3 series, and keeps series 4, 5 and 6.
When I output the chart object to console, it shows:
There is not a single mention of "Motorola", "Huawei" or "Overig" in my code, but, when I add console.log(params) to
charts.tooltip.formatter
, it shows:So, they are not in my chart object, but Echarts still draws them, and as you can see, they still exist in the tooltip params.
The chart does update well when using
chartInstance.clear()
beforechartInstance.setOption()
, but then I'll lose all the nice transitions and animations, which make ECharts look so beautiful.