Customizing Legend in TimeSeries Chart

A free public discussion forum for JFreeDesigner, a report definition designer for JFreeReport.
Locked
sakthirevs
Posts: 1
Joined: Tue May 22, 2007 5:13 pm

Customizing Legend in TimeSeries Chart

Post by sakthirevs » Tue May 22, 2007 5:19 pm

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?.....

mjs483
Posts: 9
Joined: Thu May 24, 2007 7:02 pm

Post by mjs483 » Thu May 24, 2007 7:09 pm

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.

mjs483
Posts: 9
Joined: Thu May 24, 2007 7:02 pm

Post by mjs483 » Thu May 24, 2007 9:29 pm

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.

se
Posts: 3
Joined: Wed Aug 20, 2008 4:16 am

Post by se » Wed Aug 20, 2008 4:18 am

Topic is:

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

(Just add the www to the front)

se
Posts: 3
Joined: Wed Aug 20, 2008 4:16 am

Post by se » Fri Aug 22, 2008 2:52 am

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

chaitukrishna_gonam
Posts: 3
Joined: Thu Sep 25, 2008 12:42 pm

Re: Customizing Legend in TimeSeries Chart

Post by chaitukrishna_gonam » Thu Sep 25, 2008 12:56 pm

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

Locked