w840980261 commented on issue #15967:
URL: https://github.com/apache/echarts/issues/15967#issuecomment-956065023


   ```
   <template>
     <div ref="treemapDom" class="treemap"></div>
     <button @click="clickReset">reset</button>
   </template>
   
   <script>
   import * as echarts from 'echarts'
   import { ref, onMounted } from 'vue'
   export default {
     setup() {
       const treemapDom = ref()
       const myChart = ref()
       const drawMyChart = () => {
         const option = {
           series: [
             {
               type: 'treemap',
               data: [
                 {
                   name: 'nodeA',
                   value: 10,
                   children: [
                     {
                       name: 'nodeAa',
                       value: 4,
                     },
                     {
                       name: 'nodeAb',
                       value: 6,
                     },
                   ],
                 },
                 {
                   name: 'nodeB',
                   value: 20,
                   children: [
                     {
                       name: 'nodeBa',
                       value: 20,
                       children: [
                         {
                           name: 'nodeBa1',
                           value: 20,
                         },
                       ],
                     },
                   ],
                 },
               ],
             },
           ],
         }
         myChart.value.setOption(option)
       }
       onMounted(() => {
         myChart.value = echarts.init(treemapDom.value)
         drawMyChart()
       })
   
       const clickReset = () => {
         myChart.value.resize()
       }
       return {
         treemapDom,
         clickReset,
       }
     },
   }
   </script>
   <style scoped>
   .treemap {
     width: 100%;
     height: 600px;
   }
   </style>
   ```


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