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/31 08:26:05 UTC

[GitHub] [echarts] daisybaicai opened a new issue #15055: echarts 饼图 负数问题

daisybaicai opened a new issue #15055:
URL: https://github.com/apache/echarts/issues/15055


   ### Version
   5.1.1
   
   ### Steps to reproduce
   ```
         const data = [
                   {value:625000, name:'直接访问'},
                   {value:88000, name:'邮件营销'},
                   {value:0, name:'联盟广告'},
                   {value:-712751, name:'视频广告'},
         ];
   option = {
       title : {
           text: '某站点用户访问来源',
           subtext: '纯属虚构',
           x:'center'
       },
       tooltip : {
           trigger: 'item',
           formatter: "{a} <br/>{b} : {c} ({d}%)"
       },
       legend: {
           orient : 'vertical',
           x : 'left',
           data:['直接访问','邮件营销','联盟广告','视频广告'],
            formatter: function(name) {
               var target
               for (var i = 0, l = data.length; i < l; i  ) {
                 if (data[i].name === name) {
                   target = data[i].value
                 }
               }
               var arr = [`{a|${name}}{b|${target}}{c|万TEU}`]
               return arr.join('\n')
             },
       },
       toolbox: {
           show : true,
           feature : {
               mark : {show: true},
               dataView : {show: true, readOnly: false},
               magicType : {
                   show: true, 
                   type: ['pie', 'funnel'],
                   option: {
                       funnel: {
                           x: '25%',
                           width: '50%',
                           funnelAlign: 'left',
                           max: 1548
                       }
                   }
               },
               restore : {show: true},
               saveAsImage : {show: true}
           }
       },
       calculable : true,
       series : [
           {
               name:'访问来源',
               type:'pie',
               radius : '55%',
               center: ['50%', '60%'],
               data:[
                   {value:625000, name:'直接访问'},
                   {value:88000, name:'邮件营销'},
                   {value:0, name:'联盟广告'},
                   {value:-712751, name:'视频广告'},
               ]
           }
       ]
   };
   ```
   
   ### What is expected?
   希望负数在饼图上不显示,但是左侧的legend还是显示数值
   
   ### What is actually happening?
   但饼图中负数会因为太大,直接覆盖掉了其他的数值
   
   <!-- 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:
users@infra.apache.org



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


[GitHub] [echarts] echarts-bot[bot] commented on issue #15055: echarts 饼图 负数问题

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on issue #15055:
URL: https://github.com/apache/echarts/issues/15055#issuecomment-851311659






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


[GitHub] [echarts] ssthouse commented on issue #15055: echarts 饼图 负数问题

Posted by GitBox <gi...@apache.org>.
ssthouse commented on issue #15055:
URL: https://github.com/apache/echarts/issues/15055#issuecomment-853505992


   @Ovilia hi, 这个issue可以让我试试不~


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


[GitHub] [echarts] plainheart closed issue #15055: echarts 饼图 负数问题

Posted by GitBox <gi...@apache.org>.
plainheart closed issue #15055:
URL: https://github.com/apache/echarts/issues/15055


   


-- 
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: commits-unsubscribe@echarts.apache.org

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


[GitHub] [echarts] Ovilia commented on issue #15055: echarts 饼图 负数问题

Posted by GitBox <gi...@apache.org>.
Ovilia commented on issue #15055:
URL: https://github.com/apache/echarts/issues/15055#issuecomment-855772612


   @ssthouse 非常欢迎!


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


[GitHub] [echarts] Ovilia commented on issue #15055: echarts 饼图 负数问题

Posted by GitBox <gi...@apache.org>.
Ovilia commented on issue #15055:
URL: https://github.com/apache/echarts/issues/15055#issuecomment-851874272


   在设计饼图的时候没有考虑负数的情况,可以改进一下,或许可以把负数值作为0同样地表现(除了 label)。@daisybaicai 是否感兴趣提个 PR 来尝试解决一下呢?参见 [wiki](https://github.com/apache/echarts/wiki),我们也可以给你提供更进一步的帮助~


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


[GitHub] [echarts] ssthouse commented on issue #15055: echarts 饼图 负数问题

Posted by GitBox <gi...@apache.org>.
ssthouse commented on issue #15055:
URL: https://github.com/apache/echarts/issues/15055#issuecomment-853505992


   @Ovilia hi, 这个issue可以让我试试不~


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