section color of pie chart
-
- Posts: 6
- Joined: Tue Apr 24, 2007 12:16 pm
section color of pie chart
how can we customize section color in pie chart?
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Use the setSectionPaint() method.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


-
- Posts: 6
- Joined: Tue Apr 24, 2007 12:16 pm
section color of pie chart
is there any way to implement array or list of n colors for sections?
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Do you mean something like this?
Code: Select all
Color[] colours = new Color[] {Color.red, Color.green, Color.blue};
for (int i = 0; i < colours.length; i++) {
plot.setSectionPaint(i, colours[i]);
}
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


-
- Posts: 6
- Joined: Tue Apr 24, 2007 12:16 pm