legend.setPosition()

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

legend.setPosition()

Postby magher » Wed Dec 06, 2017 8:49 am

Hi,

I upgraded from 1.0.19 to 1.5.0 and legend.setPosition seems to be deprecated. I tried some variations from the API, but I cannot get the hang of it.

Code in jfreechart 1.0.19...

Code: Select all
// Set legends on right side
LegendTitle legend = chart.getLegend();
legend.setPosition(RectangleEdge.RIGHT);


I tried legend.setLegendItemGraphicLocation(RectangleEdge.RIGHT) and legend.setLegendItemGraphicAnchor(RectangleAnchor.RIGHT) but no luck. I cannot understand the usage from the API so I'm a bit lost.
magher
 
Posts: 3
Joined: Thu Feb 20, 2014 11:38 am

Re: legend.setPosition()

Postby david.gilbert » Wed Dec 06, 2017 4:41 pm

The setPosition() method is still there, it is just that the class used for the argument (RectangleEdge) has moved to a new package *within* JFreeChart (so the JCommon dependency could be dropped). So make sure you are not importing the old RectangleEdge class from JCommon.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Ask your company to buy the JFreeChart Developer Guide
:idea: Check out other products sold by my company Object Refinery Limited
david.gilbert
JFreeChart Project Leader
 
Posts: 11653
Joined: Fri Mar 14, 2003 10:29 am

Re: legend.setPosition()

Postby magher » Thu Dec 07, 2017 9:14 am

It works :D Thank you.

//Magnus
magher
 
Posts: 3
Joined: Thu Feb 20, 2014 11:38 am


Return to JFreeChart

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 8 guests