hai2007 opened a new issue #16608:
URL: https://github.com/apache/echarts/issues/16608


   ### Version
   
   5.2.2
   
   ### Link to Minimal Reproduction
   
   _No response_
   
   ### Steps to Reproduce
   
   ```html
   <!DOCTYPE html>
   <html lang="en">
   
   <head>
       <meta charset="UTF-8">
       <script src="./echarts-5.2.2.js"></script>
   </head>
   
   <body>
   
       <div style="width:400px;height:400px"></div>
   
       <script>
           var handler = echarts.init(document.getElementsByTagName('div')[0]);
   
         try{
           handler.setOption({
               "xAxis": {
                   "type": "category",
                   "data": [
                   "一","二","三","四","五","六","七"
                   ]
               },
               "yAxis": {
                   "type": "value"
               },
               "series": [
                   {
                       "data": {},
                       "type": "bar"
                   }
               ]
           })
         }catch(e){
             console.error(e);
         }
   
         setTimeout(function(){
           // handler.clear();
           handler.setOption({
               "xAxis": {
                   "type": "category",
                   "data": [
                       "一","二","三","四","五","六","七"
                   ]
               },
               "yAxis": {
                   "type": "value"
               },
               "series": [
                   {
                       "data": [
                           "4","9","2","8","8","6","4"
                       ],
                       "type": "bar"
                   }
               ]
           });
         },1000)
       </script>
   
   </body>
   
   </html>
   ```
   
   ### Current Behavior
   
   ```js
   
   echarts.js:566 Uncaught Error: `setOption` should not be called during main 
process.
       at assert (echarts.js:566:19)
       at ECharts.setOption (echarts.js:29721:11)
       at ECharts.clear (echarts.js:30187:14)
       at index.html:39:17
   ```
   
   ### Expected Behavior
   
   正确绘制
   
   ### Environment
   
   ```markdown
   - OS:win11
   - Browser:Chrome/98.0.4758.102
   - 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: commits-unsubscr...@echarts.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org
For additional commands, e-mail: commits-h...@echarts.apache.org

Reply via email to