Re: New Approach to show LegendTitle

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
vrsarav
Posts: 16
Joined: Mon Nov 09, 2009 4:34 pm
antibot: No, of course not.

Re: New Approach to show LegendTitle

Post by vrsarav » Fri Nov 20, 2009 8:59 pm

This topic was started by celso in Jfreechart - stock Market forum. I thought this is relevant to general forum as well.
http://www.jfree.org/phpBB2/viewtopic.php?f=10&t=27546

My latest query regarding that post was
Nice approach. I just did try using it. THough not perfect it works fine. At the moment, just adding to Top and Bottom works fine. Left and Right doesn't look that good.
I have one question. When we add LegendTitle with this new approach, I expect mouse click on it to return LegendItemEntity object.
But it doesn't seem to. Regular Legend's moue click gives the corresponding series, i guess.
Is there a way to make this derive as a valid chart entity so that i could cast it to LegendItemEntity?

paradoxoff
Posts: 1634
Joined: Sat Feb 17, 2007 1:51 pm

Re: New Approach to show LegendTitle

Post by paradoxoff » Sun Nov 22, 2009 1:45 pm

The code in the linked thread doesn´t use the return value of Title.draw(Graphics2D g2,Rectangle2D area,Object params).
This return value is an instance of BlockResult which contains the ChartEntities created during the drawing process.

vrsarav
Posts: 16
Joined: Mon Nov 09, 2009 4:34 pm
antibot: No, of course not.

Re: New Approach to show LegendTitle

Post by vrsarav » Mon Nov 23, 2009 3:47 pm

Thanks paradoxoff.
I have used the return value to add it to the entity collection of the chartRenderingInfo object and now i get the LegendItemEntity objects during the mouse click events.

Thanks for the resolution.

Locked