100pah commented on PR #21201:
URL: https://github.com/apache/echarts/pull/21201#issuecomment-3342603444

   Before this issue is thoroughly resolved, an workaround can be used:
   
   ```js
   // --- Bad (May be unexpected) ---
   const chart1 = echarts.init(mainDOMElement);
   chart1.setOption(option1);
   chart1.setOption(option2); // call `setOption` in "merge mode"
   chart1.setOption(option3);
   chart1.setTheme('dark');
   // After calling `setTheme`, the previous options (option1 and option2) are 
discarded. Only the last option (option3) is retained.
   
   // --- Solution ---
   const chart1 = echarts.init(mainDOMElement);
   // Make sure every option contains all the information and using `notMerge 
mode` in `setOption`.
   chart1.setOption(option1, {notMerge: true});
   chart1.setOption(option2, {notMerge: true});
   chart1.setOption(option3, {notMerge: true});
   chart1.setTheme('dark');
   // The previous options (option1 and option2) are also discarded. But the 
last option (option3) contains all the information and retained, so the finall 
effect is correct.
   ```
   


-- 
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]

Reply via email to