Tooltips in combined chart

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

Tooltips in combined chart

Post by Gloria » Sun Jan 26, 2003 5:55 am

Hi All, I'm ploting a combined chart of time series and vertical bar chart. I have set the following code to generate the tooltips:

// create subplot 1...
XYDataset priceData = DemoDatasetFactory.createPriceDataset(code, type, fyear, fmonth, tyear, tmonth, pattern, window);
XYItemRenderer renderer1 = new StandardXYItemRenderer();
renderer1.setToolTipGenerator(new TimeSeriesToolTipGenerator("d-MMM-yyyy", "0.00"));
NumberAxis axis = new VerticalNumberAxis("Price");
axis.setAutoRangeIncludesZero(false);
XYPlot subplot1 = new XYPlot(priceData, null, axis, renderer1);

// create subplot 2...
IntervalXYDataset volumeData = DemoDatasetFactory.createVolumeDataset(code, type, fyear, fmonth, tyear, tmonth, pattern, window);

XYItemRenderer renderer2 = new VerticalXYBarRenderer(0.20);
renderer2.setToolTipGenerator(new TimeSeriesToolTipGenerator("d-MMM-yyyy", "0.00"));
XYPlot subplot2 = new XYPlot(volumeData, null, new VerticalNumberAxis("Volume"), renderer2);

But when the graph display, I can't see the tooltips....what's wrong with my code?! or I need to enable anything in other class?!
Thx!

Gloria

David Gilbert

Re: Tooltips in combined chart

Post by David Gilbert » Mon Jan 27, 2003 9:45 pm

Hi Gloria,

I can't see anything obviously wrong...at one point, the tooltips were only working for the first subplot, maybe that is the problem. I'll double check that it is fixed for the 0.9.5 release.

Regards,

Dave Gilbert

Gloria

Re: Tooltips in combined chart

Post by Gloria » Wed Jan 29, 2003 8:59 am

Hi Gilbert,

I know what's happened with my code. Since I'm using Servlet and HTML to output my chart, the tooltips cannot work on it...It only works with Applet..So...I can't make use of this tooltips....Thx!

Regards,
Gloria

Locked