iyel
iyel

Reputation: 135

Highcharts pie chart hide zero sector

There is always thin sector for 0 (0%) value. How can I hide zero value sector on a pie chart. http://jsfiddle.net/t0hgLx2n/

data: [
        ['Firefox',   100.0],
        ['Others',   0]
      ]

Remove this white line enter image description here
(source: piccy.info)

Upvotes: 1

Views: 4716

Answers (2)

samiralibabic
samiralibabic

Reputation: 109


It's been a while but if anyone stumbles upon this you have to update Highcharts to at least version 5.

Example

Replace:

<script src="http://code.highcharts.com/4.0/highcharts.js"></script>

With:

<script src="http://code.highcharts.com/6.0/highcharts.js"></script>

Upvotes: -1

KunTse Wu
KunTse Wu

Reputation: 61

This question could be resolved by two parts:

  1. filter zero data

        data: [
            ['Firefox',   100.0],
            ['Others',   0]
        ].filter(function(d) {return d[1] > 0})
    
  2. remove border in one-slice pie

    (please refer to Border in one-slice pie #1828)


http://jsfiddle.net/Joe_Wu/sub2houn/

Upvotes: 6

Related Questions