ay86 opened a new issue, #21200: URL: https://github.com/apache/echarts/issues/21200
### Version 6.0.0 ### Link to Minimal Reproduction https://jsfiddle.net/plainheart/e46ozpqj/7/ ### Steps to Reproduce Click the setTheme button and observe the changes in the chart data. It loses the updated series. ### Current Behavior setOption() can merge new options and is often used when dynamically updating data. However, when setTheme() is executed, the later updated options will be lost. ```js const chart = echarts.init(document.getElementById("chart-container")); // first option chart.setOption({ xAxis: { type: "category", data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], }, yAxis: { type: "value", }, series: [], }); // update option chart.setOption({ series: [ { data: [120, 200, 150, 80, 70, 110, 130], type: "bar", showBackground: true, backgroundStyle: { color: "rgba(180, 180, 180, 0.2)", }, }, ], }); // run this method will lose updated options function setDark() { // set theme chart.setTheme("dark"); } ``` ### Expected Behavior I hope to update the theme normally after executing setTheme() without losing the current options. ### Environment ```markdown - OS: - Browser: - Framework: ``` ### Any additional comments? _No response_ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
