I can't figure out how to get flot.pie to change the pie slice color, just the series color. Is this possible?
Asked
Active
Viewed 1.5k times
2 Answers
86
You need to specify the color as part of the data array.
So instead of
[1, 2, 3]
you do
[
{data: 1, color: '#f00'},
{data: 2, color: '#0f0'},
{data: 3, color: '#00f'}
]

Tamlyn
- 22,122
- 12
- 111
- 127
-
9This should be the accepted answer as the examples page does not show how to set the color per slice – MattSizzle Apr 28 '14 at 21:10
5
You need to create multiple data series and set the color on each series. See the Flot Pie chart examples here: Flot Pie Chart

Prasad Jadhav
- 5,090
- 16
- 62
- 80

DarrellNorton
- 3,901
- 2
- 21
- 21
-
1Link is not working. Actual js is always helpful. Current flot pie example link is: http://www.flotcharts.org/flot/examples/series-pie/ but this page does not answer the question. Look below for answer peeps. – Robb Sadler Nov 15 '16 at 19:29