Show graph value when the cursor is placed on the graph

I am using jfreechart to draw graphs. I need to show the value when the cursor is placed on the graph.

+1


source to share


2 answers


Use ToolTipManager. If you can register the graph as a component, you can assign it a specific prompt that will be displayed automatically.



If you can't use the default version, you can also write your own ToolTipManager that displays a tooltip when the cursor is over certain areas on the screen.

+1


source


I've never used jfreechart hints before, but this is possibly what you are looking for.



The org.jfreechart.labels package has a number of specific chart tooltip interfaces / classes. For example, using the XyToolTipGenerator with an XYItemRenderer might do what you are looking for.

0


source







All Articles