1

What would be the simplest approach to add/customize a tooltip on a JFreeChart DialPlot (in a Java Swing application)?

While it is fairly straightforward to customize tooltips on other chart types (e.g. implement CategoryToolTipGenerator for category charts), I couldn't find any documentation on how to achieve this on dial / meter charts.

Many thanks for any hint!

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
Tom
  • 1,375
  • 3
  • 24
  • 45
  • What have you tried? Please show your effort and consider post a [MCVE](http://stackoverflow.com/help/mcve) reproducing your problem. – dic19 Sep 15 '14 at 13:31
  • Well, my first question is: does JFreeChart offer this functionality (I couldn't find it in the JavaDoc). If not, what would be the best overall approach (e.g. add a transparent panel with a tooltip?) – Tom Sep 15 '14 at 13:49

1 Answers1

1

As suggested here, the usual implementation of tooltips requires support for chart entities, which is not available in DialPlot. Because DialPlot handles its own rendering, you might consider whether a DialLayer could meet your requirement. DialTextAnnotation or DialValueIndicator, illustrated here, may be suitable You could also implement your own DialLayer.

Community
  • 1
  • 1
trashgod
  • 203,806
  • 29
  • 246
  • 1,045
  • 1
    Thanks. I implemented now the following workaround: override the ChartPanel getToolTipText(MouseEvent evt) method. – Tom Sep 15 '14 at 17:26