customization of label in the pie chart and bar graph

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
kapilkaps83
Posts: 9
Joined: Fri Jun 13, 2008 4:09 am
Location: Japan

customization of label in the pie chart and bar graph

Post by kapilkaps83 » Thu Jun 26, 2008 6:22 am

Hi

please help me !!!!

i want to customizes my labels in pie chart and bar chart..
how can i do that

RichardWest
Posts: 844
Joined: Fri Oct 13, 2006 9:29 pm
Location: Sunnyvale, CA

Re: customization of label in the pie chart and bar graph

Post by RichardWest » Thu Jun 26, 2008 6:41 am

kapilkaps83 wrote:i want to customizes my labels in pie chart and bar chart..
For the former, create a class that implements PieSectionLabelGenerator. For the latter, create a class that implements CategoryItemLabelGenerator. Assign a instance of each class to their respective plot.
Richard West
Design Engineer II
Advanced Micro Devices
Sunnyvale, CA

kapilkaps83
Posts: 9
Joined: Fri Jun 13, 2008 4:09 am
Location: Japan

Post by kapilkaps83 » Thu Jun 26, 2008 9:04 am

Thanks

rahul
Posts: 6
Joined: Thu Jun 26, 2008 1:08 pm

Post by rahul » Thu Jun 26, 2008 1:51 pm

I also need to use CategoryItemLabelGenerator. Can you please show a piece of code of how to use it?

Thanks

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Thu Jun 26, 2008 3:02 pm

rahul wrote:I also need to use CategoryItemLabelGenerator. Can you please show a piece of code of how to use it?
I think I already answered your question in another thread. It doesn't really help to ask twice, it just clutters the forum with duplication.

http://www.jfree.org/phpBB2/viewtopic.php?t=24992
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

kapilkaps83
Posts: 9
Joined: Fri Jun 13, 2008 4:09 am
Location: Japan

Post by kapilkaps83 » Fri Jun 27, 2008 4:58 am

hi david.gilbert

i have generated a simple bar graph ( not category plot) . i simply want to display a label with some message below each bar..
the sample dataset used by me is

dataset.addValue(8, 1回, "");
dataset.addValue(4, 2回, "");
dataset.addValue(9, 3回, "");
dataset.addValue(5, 4回, "");
dataset.addValue(3, 5回, "");


now if i change my dataset to


dataset.addValue(8, 1回, "1回");
dataset.addValue(4, 1回, "2回");
dataset.addValue(9, 1回, "3回");
dataset.addValue(5, 1回, "4回");
dataset.addValue(3, 1回, "5回");

Then i have solved my problem but in this case legend is 1回 and all bar are of same color

i want to display bar graph with label below each bar and each bar has to be in different color

Please help me with some sample code.

Locked