Set the section color on a Pie chart

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
bharat C

Set the section color on a Pie chart

Post by bharat C » Thu Mar 21, 2002 8:54 pm

Is it possible to choose the color for the sections on a pie chart..
Thanks
--bharat

David Gilbert

Re: Set the section color on a Pie chart

Post by David Gilbert » Fri Mar 22, 2002 9:25 am

Yes. Construct an array of Paint objects and pass it to the Plot class via the setSeriesPaint(...) method. The plot will use each Paint in turn and cycle back to the start of the array if there are more sections in the plot than there are Paint objects in the array. The same applies to all the other plot types.

Regards,

DG.

Locked