msbasanth opened a new issue #15138:
URL: https://github.com/apache/echarts/issues/15138


   ### Version
   5.0.1
   
   ### Steps to reproduce
   We compared using full echarts against echarts tree shakable API's.
   
   Option 1: Full ECharts imported
   ```
   var echarts = require('echarts');
   var chartDom = document.getElementById('main');
   var myChart = echarts.init(chartDom);
   var option;
   
   option ={
       title: {
           text: '饼图程序调用高亮示例',
           left: 'center'
       },
       tooltip: {
           trigger: 'item',
           formatter: '{a} <br/>{b} : {c} ({d}%)'
       },
       legend: {
           orient: 'vertical',
           left: 'left',
           data: ['直接访问', '邮件营销', '联盟广告', '视频广告', '搜索引擎']
       },
       series: [
           {
               name: '访问来源',
               type: 'pie',
               radius: '55%',
               center: ['50%', '60%'],
               data: [
                   {value: 335, name: '直接访问'},
                   {value: 310, name: '邮件营销'},
                   {value: 234, name: '联盟广告'},
                   {value: 135, name: '视频广告'},
                   {value: 1548, name: '搜索引擎'}
               ],
               emphasis: {
                   itemStyle: {
                       shadowBlur: 10,
                       shadowOffsetX: 0,
                       shadowColor: 'rgba(0, 0, 0, 0.5)'
                   }
               }
           }]
   };
   
   option && myChart.setOption(option);
   ```
   **Our observation is this:**
   
![image](https://user-images.githubusercontent.com/17777813/121697954-2d3c8b80-caeb-11eb-8d9c-4e6321ad8603.png)
   
   Total Main.js Size: **1.2 MB**
   
   Option 2: Using tree shakable API's from ECharts
   ```
   import * as echarts from 'echarts/core';
   
   import {
     PieChart
   } from 'echarts/charts';
   
   import {
     TitleComponent,
     TooltipComponent,
     GridComponent
   } from 'echarts/components';
   
   import {
     SVGRenderer
   } from 'echarts/renderers';
   
   echarts.use(
     [TitleComponent, TooltipComponent, GridComponent, PieChart, SVGRenderer]
   );
   ```
   
   **Observation**
   
![image](https://user-images.githubusercontent.com/17777813/121698034-40e7f200-caeb-11eb-82f7-6783a609119c.png)
   
   
   Total Main.js Size: **1.3 MB**
   
   ### What is expected?
   We should get a reduced overall package size when tree shakable API is 
introduced. 
   
   ### What is actually happening?
   So as you could see total size of main.js increased with tree shakable API 
usage. What could be the reason for the increase in package size after using 
tree shakable API?
   
   Please let us know in case the approach we followed is not correct.
   
   <!-- This issue is generated by echarts-issue-helper. DO NOT REMOVE -->
   <!-- This issue is in English. DO NOT REMOVE -->


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

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