Specify slice colors in a pie chart using CSS

Article ID: 2246
Last updated: 29 May, 2018
Article ID: 2246
Last updated: 29 May, 2018
Revision: 3
Views: 712
Posted: 12 Oct, 2004
by Dean J.
Updated: 29 May, 2018
by Gargani A.

Question

How can I specify slice colors in a pie chart using CSS?

Answer

You can specify colors for the slices according to the index number of the individual points in the data series. For example (x is the index): 

chart {
type: Pie;
}
point[x==1]{
color1: yellow;
}
point[x==2]{
color1: red;
}
point[x==3]{
color1:blue;
}
point[x==4]{
color1: pink;
}

This article was:   Helpful | Not helpful
Report an issue
Article ID: 2246
Last updated: 29 May, 2018
Revision: 3
Views: 712
Posted: 12 Oct, 2004 by Dean J.
Updated: 29 May, 2018 by Gargani A.
Also listed in


Others in this category