jane0326 opened a new issue #8682: 矩形树图,同一个层级里有多组数据,怎么江浙多组数据设置成图例?
URL: https://github.com/apache/incubator-echarts/issues/8682
 
 
   <!--
   为了方便我们能够复现和修复 bug,请遵从下面的规范描述您的问题。
   -->
   
   
   ### One-line summary [问题简述]
   同一个层级下有多组地位相同的数据,怎么将这组数据里的name值设置成legend图例的值?
   
   
   
   
   ### Version & Environment [版本及环境]
   + ECharts version [ECharts 版本]:4
   + Browser version [浏览器类型和版本]:chrome
   + OS Version [操作系统类型和版本]:window10
   
   
   
   
   
   ### Expected behaviour [期望结果]
   
   
   
   
   
   ### ECharts option [ECharts配置项]
   <!-- Copy and paste your 'echarts option' here. -->
   <!-- [下方贴你的option,注意不要删掉下方 ```javascript 和 尾部的 ``` 字样。最好是我们能够直接运行的 
option。如何得到能运行的 option 参见上方的 guidelines for contributing] -->
   ```javascript
   let example = '当月值';
   option = {
       legend:{
           x : 'center',
           y : 'top',
           
data:['全国冰激凌套餐1','3G手机套餐2','4G全国套餐3','全国冰激凌套餐4','3G手机套餐5','4G全国套餐6','全国冰激凌套餐74','3G手机套餐8','4G全国套餐9']
       },
       series: [{
           name:"矩形树图",
           roam:false,
           nodeClick:false,
           breadcrumb:{
               show:false,
           },
           type: 'treemap',
           data: [{
                       "name": "全国冰激凌套餐1",
                       "value": "301"
                   }, {
                       "name": "3G手机套餐2",
                       "value": "501"
                   }, {
                       "name": "4G全国套餐3",
                       "value": "501"
                   }, {
                       "name": "全国冰激凌套餐4",
                       "value": "501"
                   }, {
                       "name": "3G手机套餐5",
                       "value": "501"
                   }, {
                       "name": "4G全国套餐6",
                       "value": "310"
                   },{
                       "name": "全国冰激凌套7",
                       "value": "891"
                   }, {
                       "name": "3G手机套餐8",
                       "value": "601"
                   }, {
                       "name": "4G全国套餐9",
                       "value": "401"
                   }],
           label:{
            show:true,
            normal:{
                position:'insideTopLeft',
                fontSize:'14',
                offset:[5,5],
                formatter:['{titleStyle|{b}}',example+':{c}'].join('\n\n'),
                rich:{
                   titleStyle:{
                       color: '#FFFF33',
                       fontSize:'14'
                   },       
                }
            }
           }
       }],
   };
   
   
   ```
   
   
   
   
   ### Other comments [其他信息]
   <!-- For example: Screenshot or Online demo -->
   <!-- [例如,截图或线上实例 (JSFiddle/JSBin/Codepen)] -->
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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

Reply via email to