LegendItemToolTipGenerator - tooltips for legend items??

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
jusepi
Posts: 16
Joined: Tue May 09, 2006 1:18 pm
Location: USA

LegendItemToolTipGenerator - tooltips for legend items??

Post by jusepi » Thu Oct 12, 2006 1:34 am

Hi, I would like to put tooltips on the legend items in an XYPlot. I noticed the method:

Code: Select all

setLegendItemToolTipGenerator(XYSeriesLabelGenerator generator)
under the XYLineAndShapeRenderer object. But for some reason, it seems to do nothing. I even see print out statements that I inserted in my own custom XYSeriesLabelGenerator under the generateLabel method. So it looks like the data is there but just not getting used. Is this an unimplemented method as of 1.0.2? Is there anyone out there who has tried dealing with this? Thanks much.

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 » Thu Oct 12, 2006 9:38 am

It is a bug, unfortunately. The fix is in CVS, ready for the 1.0.3 release. Here is the ChangeLog entry:

Code: Select all

2006-10-06  David Gilbert  <david.gilbert@object-refinery.com>

    * source/org/jfree/chart/title/LegendItemBlockContainer.java
    (toolTipText): New field,
    (urlText): Likewise,
    (getToolTipText): New method,
    (setToolTipText): Likewise,
    (getURLText): Likewise,
    (setURLText): Likewise,
    (draw): Add tool tip text and URL text to the legend item entity,
    * source/org/jfree/chart/title/LegendTitle.java
    (createLegendItemBlock): Set the tool tip and URL text in the block.
David Gilbert
JFreeChart Project Leader

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

jusepi
Posts: 16
Joined: Tue May 09, 2006 1:18 pm
Location: USA

other changes?

Post by jusepi » Thu Oct 12, 2006 5:00 pm

Thanks for the note.

What happened to LegendItemBlockContainer? It's marked as dead in CVS, but the latest version of LegendTitle still uses it. Also this means that LegendItemEntity will need to change as well right? So I assume this feature is not working as of yet...

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 » Thu Oct 12, 2006 5:55 pm

Are you looking at the STABLE_1-0-0 branch?
David Gilbert
JFreeChart Project Leader

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

jusepi
Posts: 16
Joined: Tue May 09, 2006 1:18 pm
Location: USA

Post by jusepi » Fri Oct 13, 2006 1:47 am

ya, that's what I found on sourceforge.
But I've added the changes you mentioned and copied the LegendTitle class from CVS, and it works great. Thanks a bunch for the tips.

Locked