You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2021/05/18 10:25:23 UTC

[GitHub] [echarts] mishengqiang commented on pull request #10388: Fix formatter display wrong value

mishengqiang commented on pull request #10388:
URL: https://github.com/apache/echarts/pull/10388#issuecomment-843051199


   5.1.1问题依然存在看图
   ![image](https://user-images.githubusercontent.com/9413032/118635584-53ca1800-b806-11eb-8746-fb5352566d83.png)
   
   ```js
   option = {
       title: {
           text: '某站点用户访问来源',
           subtext: '纯属虚构',
           left: 'center'
       },
       tooltip: {
           trigger: 'item',
           formatter: "{a}<br/>{@value}<br/>{c}",
       },
       label: {
                 formatter: "{b}:{@value}",
               },
       legend: {
           orient: 'vertical',
           left: 'left',
       },
       dataset:{
           source: [
                   {value: 1048, name: '搜索引擎'},
                   {value: 735, name: '直接访问'},
                   {value: 580, name: '邮件营销'},
                   {value: 484, name: '联盟广告'},
                   {value: 300, name: '视频广告'}
               ]
       },
       series: [
           {
               name: '访问来源',
               type: 'pie',
               radius: '50%',
               encode:{
                   itemName:"name",
                   value:"value",
               },
               // tooltip: {
               //   formatter: "{a}<br/>{c}",
               // },
               emphasis: {
                   itemStyle: {
                       shadowBlur: 10,
                       shadowOffsetX: 0,
                       shadowColor: 'rgba(0, 0, 0, 0.5)'
                   }
               }
           }
       ]
   };
   ```
   


-- 
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:
users@infra.apache.org



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