How can I use tooltips generator?

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

How can I use tooltips generator?

Post by Marcelo Medeiros » Tue Oct 22, 2002 4:23 pm

Hi all,

I´m using a StackedHorizontalBarChart in my application and I´d like to
format the tooltips. How can I do it? I know that I must use the
TooltipGenerator interface but I didn´t find yet a method like
setTooltipGenerator in any class?
Anyone has a code example?

Thanks in advance

Marcelo

Dave Gilbert

Re: How can I use tooltips generator?

Post by Dave Gilbert » Tue Oct 22, 2002 4:42 pm

The StackedHorizontalBarRenderer class inherits a method setToolTipGenerator(...) from the AbstractCategoryItemRenderer class. So if you have written your own implementation of the CategoryToolTipGenerator interface, then you can set it using code something like this:

BarRenderer renderer = (BarRenderer) myPlot.getRenderer();
renderer.setToolTipGenerator(myToolTipGenerator);

Regards,

DG.

Locked