JFreeChart tooltip unexpected residue

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
tomtom79
Posts: 8
Joined: Thu Aug 02, 2012 7:39 pm
antibot: No, of course not.

JFreeChart tooltip unexpected residue

Post by tomtom79 » Mon Sep 15, 2014 12:06 pm

Hi all,

I asked the following question on stackexchange but didn't get any solution; hence this post.

My Java Swing application is making use of (the excellent) JFreeChart library but unfortunately there is an unexpected behavior: when hovering the mouse over a chart's datapoint, a customized tooltip is shown (as expected); however, after that there is a constant tooltip residue next to the mouse cursor when it is on the chart but not on a datapoint anymore (i.e. no tooltip should appear anymore).

Hereby a picture that shows the residue (grey dot at to the bottom right of the mouse cursor - it looks like the borders of an empty tooltip):
Image

The residue "follows" the mouse position and if I change application (e.g. alt-tab) and then come back, the residue disappeared. Did someone experience the same problem? Any idea how to solve this?

Technical details:
  • I'm using latest JFreeChart version (1.0.19)
  • My application is using a specific UI L&F manager but this doesn't seem to be the problem as the residue is also present without it (UI manager set as UIManager.setLookAndFeel(new SubstanceTwilightLookAndFeel())
  • The problem is present on XYLineChart and on BarChart
  • Tooltips are customized (i.e. implemented XYToolTipGenerator interface where generateToolTip() returns HTML with the tooltip content)
  • Tooltip delay is set to minimum (ChartPanel.setInitialDelay(0)) and dismiss delay to maximum (ChartPanel.setDismissDelay(Integer.MAX_VALUE))
Many thanks for any help or hint as I've been stuck on this for hours now!
Thomas

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

Re: JFreeChart tooltip unexpected residue

Post by david.gilbert » Wed Sep 17, 2014 8:38 pm

Put a breakpoint in the ChartPanel.getToolTipText() method and see if it is returning a non-null value when the mouse is over the plot background (and not over a data item). If possible, please post a small, self-contained example that reproduces the problem.
David Gilbert
JFreeChart Project Leader

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

tomtom79
Posts: 8
Joined: Thu Aug 02, 2012 7:39 pm
antibot: No, of course not.

Re: JFreeChart tooltip unexpected residue

Post by tomtom79 » Wed Sep 17, 2014 10:06 pm

Thanks for the reply.

I've checked the outcome of both ChartPanel.getToolTipText() and ChartPanel.getToolTipText(MouseEvent evt): only the later one is used and it does return null when not over a data item.

Creating a small example would take quite a bit of time given the amount of customization I'm bringing to my charts. Maybe faster to import JFreeChart source in my project and do a step-by-step debug? Where would you advise to start looking / put a breakpoint?

Thanks,
Thomas

Locked