A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Post Reply
Posts: 1
Joined: Fri Jan 31, 2020 2:31 am
antibot: No, of course not.


Post by domxch » Fri Jan 31, 2020 2:39 am


I'm using JFreeChart with 2 TimeSeries.
Everything works great but I have tried implementing the built-in tooltips as part of my attempts to do some processing when the mouse is moved over the data points.
So far as I can see this should be quite a trivial task but I've so far not been able to display any tooltips, either with my class, or even by adding them to any standard JFreeChart examples I downloaded.

From what I understand all that is required is to add the tooltip to the plot renderer:-

XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator());

And then create the chart with the correct parameters:-

JFreeChart chart = ChartFactory.createTimeSeriesChart(
"Closing price by time",
"Closing price (€)",
dataset, true, true, false

Any suggestions greatly appreciated as this should be really simple...

Post Reply