Pie charts, colors and legend around the pie

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

Pie charts, colors and legend around the pie

Post by Michael » Mon Feb 03, 2003 6:18 pm

Hi,

1) I'm trying to draw a pie chart. But i have 13 different sections and by default there is only 11 colors. So there is two red and two green.

How could I change the sections' colors ?

2) The differents sections are in the legend bottom of the pie, but around the pie too. Could I remove the second ones ?

Thanks a lot.

Michael.

reji

Re: Pie charts, colors and legend around the pie

Post by reji » Tue Feb 04, 2003 1:29 am

1) I'm trying to draw a pie chart. But i have 13 different sections and by default there is only 11 colors. So there is two red and two green.

How could I change the sections' colors ?

--> Create your own Color[] then set

Color[] colo = {Color.red, Color.yellow.........};

PiePlot plot = (PiePlot)chart.getPlot();
plot.setSeriesPaint(colo);

2) The differents sections are in the legend bottom of the pie, but around the pie too. Could I remove the second ones ?

-->

PiePlot plot = (PiePlot)chart.getPlot();
plot.setSectionLabelType(PiePlot.NO_LABELS);

Michael

Re: Pie charts, colors and legend around the pie

Post by Michael » Tue Feb 04, 2003 10:29 am

Thx :)

Locked