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 2019/09/18 13:15:23 UTC

[GitHub] [incubator-echarts] amanzyw opened a new issue #11275: pie类型的图形,在加入color时会出现移入图形闪烁

amanzyw opened a new issue #11275: pie类型的图形,在加入color时会出现移入图形闪烁
URL: https://github.com/apache/incubator-echarts/issues/11275
 
 
   <!--
   Please Use https://ecomfe.github.io/echarts-issue-helper to create the issue.
   Otherwise, it will be closed immediately.
   Questions in the form of *How to use ...* should be at Stack Overflow rather than GitHub issue list.
   
   请注意,所有 issue 必须由 https://ecomfe.github.io/echarts-issue-helper/?lang=zh-cn 创建,不然将会被直接关闭。
   Issues 中不要问「如何使用 ECharts 实现……功能」的问题,相关问题请到 SegmentFault 或 Stack Overflow 提问,详见上面的链接。
   -->
   
   let gradeName=["一级","二级","三级"],gradeList=[{"name":"一级","value":2354},{"name":"二级","value":0},{"name":"三级","value":0}];
   option = {
           title: {
             text: '总人数' + this.totalPeople + '人',
             x: 'right',
             y: 'center',
             textStyle: {
               fontSize: 16,
               fontWeight: 'bold',
               color: 'rgba(255,255,255,1)'
             }
           },
           tooltip: {
             trigger: 'item',
             formatter: '{a} <br/>{b}: {c} ({d}%)'
           },
           color: ['rgba(232,1,2,1', 'rgba(255,151,0,1)', 'rgba(62,244,1,0.67)'],
           legend: {
             // orient 设置布局方式,默认水平布局,可选值:'horizontal'(水平) ¦ 'vertical'(垂直)
             orient: 'vertical',
             // x 设置水平安放位置,默认全图居中,可选值:'center' ¦ 'left' ¦ 'right' ¦ {number}(x坐标,单位px)
             x: 'left',
             // y 设置垂直安放位置,默认全图顶端,可选值:'top' ¦ 'bottom' ¦ 'center' ¦ {number}(y坐标,单位px)
             y: 'center',
             itemWidth: 0, // 设置图例图形的宽
             itemHeight: 0, // 设置图例图形的高
             textStyle: {
               fontSize: '16',
               color: ['rgba(232,1,2,1', 'rgba(255,151,0,1)', 'rgba(62,244,1,0.67)'] // 图例文字颜色
             },
             // itemGap设置各个item之间的间隔,单位px,默认为10,横向布局时为水平间隔,纵向布局时为纵向间隔
             itemGap: 22,
             // backgroundColor: '#eee', // 设置整个图例区域背景颜色
             data: gradeName,
             // 根据name获取百分比
             formatter: function (name) {
               return name;
             }
           },
           series: [{
             name: '所有人员',
             type: 'pie',
             radius: ['50%', '96%'],
             center: ['40%', '50%'],
             hoverAnimation: false,
             // silent: true,
             avoidLabelOverlap: false,
   
             label: {
               normal: {
                 show: false
                 // position: 'left'
               },
               emphasis: {
                 show: false
                 // textStyle: {
                 //   fontSize: '17'
                 //   // fontWeight: 'bold'
                 // }
               }
               // formatter: '{d}%'
             },
             labelLine: {
               normal: {
                 show: false
               }
             },
             data: gradeList
           }],
           animation: false
         };
   
   
   以上的配置项会在echarts中会出现闪烁,去掉全局color配置就好了//color: ['rgba(232,1,2,1', 'rgba(255,151,0,1)', 'rgba(62,244,1,0.67)'],

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


With regards,
Apache Git Services

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