Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jquery flot pie slice color

Tags:

jquery

flot

I can't figure out how to get flot.pie to change the pie slice color, just the series color. Is this possible?

like image 369
Caveatrob Avatar asked Oct 19 '10 00:10

Caveatrob


2 Answers

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'}
]
like image 134
Tamlyn Avatar answered Oct 22 '22 15:10

Tamlyn


You need to create multiple data series and set the color on each series. See the Flot Pie chart examples here: Flot Pie Chart

like image 37
DarrellNorton Avatar answered Oct 22 '22 15:10

DarrellNorton