an-orange-cat commented on issue #4295:
URL: https://github.com/apache/echarts/issues/4295#issuecomment-1827560844

   我也是在找这个解决方法,看到这里发现 pyechart原来有resize方法,马上就解决了。以下是我的代码示例,仅供参考:
   ```html
   <body onresize="reSetSize()">
           <div id="chart-box" class="row">
               <div id="pyecharts-views" style="width:100%; height: calc(100vh 
- 25px);"></div>
               <!-- 25px是导航栏的高度 -->
           </div>
   </body>
   ```
   
   ```js
   <script>
       var chart = echarts.init(document.getElementById('pyecharts-views'), 
'white', { renderer: 'canvas' });
   
       $(
           function () {
               fetchData(chart);
           }
       );
   
       function fetchData() {
           $.ajax({
               type: "GET",
               url: "http://127.0.0.1:8000/test";,
               dataType: 'json',
               success: function (result) {
                   chart.setOption(result.data);
               }
           });
       }
   
       function reSetSize () {
           chart.resize()
   
       }
   </script>
   ```
   


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