Order in Legend

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
hhenrion
Posts: 12
Joined: Fri Mar 07, 2008 9:56 am

Order in Legend

Post by hhenrion » Mon Apr 14, 2008 10:53 am

Hi,

Since I have not any idea to solve my precedent questions, I try to find another solution.

In order to gain some place in my legend, is it possible to change the order of the element in the legend?

I want the text to appear in first, and then the image.

I want to have:

dddddd : ° fffffff : ° instead of ° : dddddd ° : ffffff
I am clear?

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 » Mon Apr 14, 2008 1:26 pm

Code: Select all

LegendTitle legend = chart.getLegend();
        legend.setLegendItemGraphicEdge(RectangleEdge.RIGHT);
David Gilbert
JFreeChart Project Leader

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

hhenrion
Posts: 12
Joined: Fri Mar 07, 2008 9:56 am

Post by hhenrion » Mon Apr 14, 2008 2:53 pm

Thank you for your answer but I think I was not clear enough...

I want for instance that the diamonds appear after the label corresponding in the legend caption. (Either this caption is on bottom or on Rigth, or anywhere else)

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 » Mon Apr 14, 2008 10:26 pm

That's what I thought you wanted. When you try the code I suggested, what do you see in the legend?
David Gilbert
JFreeChart Project Leader

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

hhenrion
Posts: 12
Joined: Fri Mar 07, 2008 9:56 am

Post by hhenrion » Tue Apr 15, 2008 7:45 am

:oops: I don't see what I want...
I see my chart, and the legend on his right.
And in the legend I see :
° : short term
° : medium term
° : ...
° : ...

(Instead of :
short term : °
medium term : °
... : °
... : °)

In any case, thanks for taking the time to answer me!

hhenrion
Posts: 12
Joined: Fri Mar 07, 2008 9:56 am

Post by hhenrion » Tue Apr 15, 2008 8:05 am

Re oops...

Your solution is perfect :) I misread your answer. Sorry.
Thank you.

To return to my other topic : is it possible to include another text in the legend? Like a title?

Locked