part label name problem?

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

part label name problem?

Post by robert » Wed Jun 26, 2002 10:23 am

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!

Ray Mercer

Re: part label name problem?

Post by Ray Mercer » Wed Jun 26, 2002 10:33 am

Robert,

To hide the legend:
JFreeChart chart.setLegend(null);

To hide the labels:
PiePlot plot.setSectionLabelType(PiePlot.NO_LABELS);

Hope this helps,
Ray Mercer

robert

Re: part label name problem?

Post by robert » Wed Jun 26, 2002 10:53 am

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!

Remesh

Re: part label name problem?

Post by Remesh » Wed Jun 26, 2002 12:50 pm

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

robert

Re: part label name problem?

Post by robert » Thu Jun 27, 2002 2:43 am

Thanks a lot!

Locked