tooltips using ValueMarkers

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
evilgeenius
Posts: 3
Joined: Wed Apr 26, 2006 1:34 pm

tooltips using ValueMarkers

Post by evilgeenius » Fri Jun 16, 2006 12:36 pm

Is it possible to create tooltips and linkgenerators over ValueMarkers?
So when the mouse is moved over a value marker i can click a link..

I can do it with an ordinary XY dataset but i have no idea with my value markers.

Any help is greately appreciated
Thanks
Chris

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 Jun 19, 2006 4:31 pm

It isn't supported, but only because the code that draws these markers doesn't add a ChartEntity for it. With a little refactoring this could be added, and it would certainly be a nice addition.
David Gilbert
JFreeChart Project Leader

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

Mike Watts
Posts: 13
Joined: Mon May 08, 2006 1:27 pm

Tooltips for Marker - and Dragging

Post by Mike Watts » Mon Feb 12, 2007 4:29 pm

Was this ever implemented by anyone? I want to be able to set a different cursor when over a marker to indicate it is draggable.

It looks as though the latter is not simple to do but for the moment I intend to simulate it with a line that I move over the chart panel and re-draw the marker when the mouse button is released.

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Re: Tooltips for Marker - and Dragging

Post by david.gilbert » Mon Feb 12, 2007 5:50 pm

Mike Watts wrote:Was this ever implemented by anyone? I want to be able to set a different cursor when over a marker to indicate it is draggable.
No, it hasn't been implemented. What's needed (in XYPlot for example) is to replace the drawDomainMarker() and drawRangeMarker() methods with variants that accept a PlotRenderingInfo instance - then check if the owner (ChartRenderingInfo) has a non-null EntityCollection...if it does, then add a new ChartEntity for each marker drawn. You'll probably want to extend the ValueMarker and RangeMarker classes to carry optional tooltip and URL details, which you can use to populate the ChartEntity. I don't think this is a really difficult change, but just requires a little care to ensure that it doesn't break the existing API (deprecating some methods is OK).
David Gilbert
JFreeChart Project Leader

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

Locked