I divide the pie chart into three parts:Red, Yellow and Blue and their default label names are Category1, Category2 and Category3. The three labels display underside the pie chart. Now I want not to display all the labels and plan to define text words for them instead of graph.
Would you please tell me how I should do it?
Thanks a lot!
part label name problem?
Re: part label name problem?
Robert,
To hide the legend:
JFreeChart chart.setLegend(null);
To hide the labels:
PiePlot plot.setSectionLabelType(PiePlot.NO_LABELS);
Hope this helps,
Ray Mercer
To hide the legend:
JFreeChart chart.setLegend(null);
To hide the labels:
PiePlot plot.setSectionLabelType(PiePlot.NO_LABELS);
Hope this helps,
Ray Mercer
Re: part label name problem?
That's great!Thank you very much!
By the way, when I divide the pie chart into only 2 parts, their part colors are automatically red and blue. If I want the colors are red and yellow, then how could I do it?
Thanks a lot!
By the way, when I divide the pie chart into only 2 parts, their part colors are automatically red and blue. If I want the colors are red and yellow, then how could I do it?
Thanks a lot!
Re: part label name problem?
Robert ,
Setting colors to individual parts ....
PiePlot pPlot = (PiePlot) pieChart.getPlot() ;
pPlot.setSeriesPaint(0, (Paint) Color.blue);
pPlot.setSeriesPaint(1, (Paint) Color.yellow);
Bye
Remesh
Setting colors to individual parts ....
PiePlot pPlot = (PiePlot) pieChart.getPlot() ;
pPlot.setSeriesPaint(0, (Paint) Color.blue);
pPlot.setSeriesPaint(1, (Paint) Color.yellow);
Bye
Remesh