Open
Description
Version
5.6.0
Link to Minimal Reproduction
https://jsfiddle.net/pL8u97sz/4/
Steps to Reproduce
- call
setOption
with series without markLine - call
setOption
again but spread the previous options and adds series with the markLine
chart.setOption({
xAxis: {
type: "value",
},
yAxis: {
type: "value"
},
series: [{
data: [[10,10],[20,20],[30,15],[40,10],[50,20],[60,15],],
type: "line",
}]
});
chart.setOption({
...chart.getOption(),
series: [{
data: [[10,10],[20,20],[30,15],[40,10],[50,20],[60,15],],
type: "line",
markLine: {
data: [{ xAxis: 15 }, { xAxis: 25},]
},
}]
});
Current Behavior
The chart is rendered without the marklines
Expected Behavior
The chart is rendered with the marklines
Environment
- OS: linux
- Browser: firefox 139.0.4
- Framework: react@18
Any additional comments?
Note that in my use case, I am using react.
I am updating the chart from different events.
Each does a React.useEffect
where they call setOption
and spread the previous option.
When I inspect the option from getOption
, it has the desired configuration for the chart. Thus, I expect it render the markline