用echarts制作环图,如何使中间只显示一个数据的百分比

用echarts如何实现下图效果


代码如下

series: [

            {

              type: 'pie',

              radius: ['60%', '80%'],

              center:['50%','40%'],

              data: [

                {

                  name:'点播观看率',

                  value:73,

                  itemStyle:{

                    color: {

                        type: 'linear',

                        x: 0,

                        y: 1,

                        x2: 0,

                        y2: 0,

                        colorStops: [{

                            offset: 0, color: '#356eff' // 0% 处的颜色

                        }, {

                            offset: 1, color: '#9bfcaf' // 100% 处的颜色

                        }],

                        global: false // 缺省为 false

                    },

                  },

                  label:{

                    show:true,  //单独显示该数据项

                    formatter:'{d}%'

                  }

                },

                {

                  value:27,

                  itemStyle:{

                    color: '#ccc',

                  },

                  label:{

                    emphasis:{

                      show:false

                    }

                  }

                }

              ],

              itemStyle: {

                  normal: {

                  },

              },

              label:{

                normal:{//默认不显示数据

                  show : false,

                  position:'center',

                },

                color:'#fff',

              },

            }

          ]

你可能感兴趣的:(用echarts制作环图,如何使中间只显示一个数据的百分比)