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.
Pie charts, colors and legend around the pie
Re: Pie charts, colors and legend around the pie
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);
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);