Page 1 of 1

Customizing Legend in TimeSeries Chart

Posted: Tue May 22, 2007 5:19 pm
by sakthirevs
Hi All,

I am Novice to JFreeChart. Does any one know about how to change or set the custom legend on JFreeChart. Also, is it possible to change the position and shape of the legend?.

By default the JFreeChart displays Legends at the bottom. is it possible to change it?.....

Posted: Thu May 24, 2007 7:09 pm
by mjs483
I am also interested in doing something like this. I'm trying to figure out the cleanest way to manually construct LegendItems and then create a new LegendTitle out of them. I'm getting confused because a LegendTitle only has one method that takes a LegendItem (createLegendItemBlock). Is this what I want to use to add labels to my legend?

I didn't see a section for this in the developer's guide. Help / suggestions appreciated.

Posted: Thu May 24, 2007 9:29 pm
by mjs483
Checkout this topic which explains how to make custom legend labels. It worked for me =)

Topic id = 11669

Sorry I'm a new forum user so it wouldn't let me post a link.

Posted: Wed Aug 20, 2008 4:18 am
by se
Topic is:

jfree.org/phpBB2/viewtopic.php?t=11669

(Just add the www to the front)

Posted: Fri Aug 22, 2008 2:52 am
by se
This site also has a good example :D

It shows how to customise the legend in the pie chart.

zhaoyl.javaeye.com/blog/208278

The translated version is:
translate.google.com.au/translate?hl=en&sl=zh-CN&u=<ADDHTTP://>zhaoyl.javaeye.com/blog/208278&sa=X&oi=translate&resnum=2&ct=result&prev=/search%3Fq%3Dexample%2Busage%2Bof%2Blegendtitle%2Bfor%2Bjfreechart%26start%3D10%26hl%3Den%26sa%3DN

I also can't post links. :roll: so you have to add "http" to the front of the links and to the ADDHTTP section in the translate link

Re: Customizing Legend in TimeSeries Chart

Posted: Thu Sep 25, 2008 12:56 pm
by chaitukrishna_gonam
I hope this will help you.

To change the legend position - use the below statement

chart.getLegend().setPosition(RectangleEdge.LEFT);
to set the legend in left side