d33a
d33a

Reputation: 740

Hide the labels in the pie graph in echart by baidu

I am referring to this https://ecomfe.github.io/echarts/doc/example/pie1.html#-en example. I am not able to hide the adjacent labels in the pie graph. I have encircled one of the labels I wish to hide in the attached image. Kindly help. Thanks!

enter image description here

Upvotes: 7

Views: 7067

Answers (3)

Andrey Belykh
Andrey Belykh

Reputation: 2654

Add this to EChartsOption.series

    label: {
        show: false
    },
    labelLine: {
        show: false
    },

Upvotes: 0

Ammar Siddiqi
Ammar Siddiqi

Reputation: 45

To dynamically hide the label and labelline, while passing the data to the pi-chart, you can use the following properties

{ value: 1, name: 'Open', label: { show: false }, labelLine: { show: false } },
{ value: 3, name: 'In Progress', label: { show: false }, labelLine: { show: false } },
{ value: 2, name: 'Done', label: { show: false }, labelLine: { show: false } }

Upvotes: 1

d33a
d33a

Reputation: 740

Found the solution to my problem. I had to include the following code into the options and it worked:

itemStyle : {
              normal : {
                         label : {
                                   show : false
                                  },
                         labelLine : {
                                       show : false
                                      }
                         }
              }

Upvotes: 14

Related Questions