ToolTip.

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Rajendra

ToolTip.

Post by Rajendra » Thu Jun 20, 2002 10:20 am

Hi,

I would like to set the tooltip to charts. When ever i get the cursor on to the chart, it should display the (x,y) tuple of that point ( not the high & low values).

How should i get this kind of feature?

Thanks in advance.

With Regards,
Rajendra.

David Gilbert

Re: ToolTip.

Post by David Gilbert » Thu Jun 20, 2002 11:57 am

You should be able to replace the tool tip generator in the chart's renderer:

XYPlot plot = myChart.getXYPlot();
XYItemRenderer renderer = plot.getItemRenderer();
renderer.setToolTipGenerator(myToolTipGenerator);

Maybe the StandardXYToolTipGenerator class will work for you, or the TimeSeriesToolTipGenerator...if not, just create your own class and implement the XYToolTipGenerator interface.

Regards,

DG.

Locked