crosshair value for 2nd axis

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Post Reply
Posts: 24
Joined: Sat Mar 14, 2009 3:22 pm
Location: Berlin

crosshair value for 2nd axis

Post by uli » Mon May 30, 2016 1:17 pm


I have a plot with two datasets and two range axes, where the first dataset is mapped to the first axis and the second to the second.
The crosshair is locked to the data.
If I click on a series that is in the first dataset, the crosshair is displayed correctly.
if I click on a series that is in the second dataset, the crosshair is NOT displayed correctly.

The problem here is the mapping of values from the second axis to the first axis.
I know how to map the values, but I don't know when I need to do that.
So, I need to find out, if the crosshair value comes from the first or the second dataset.
How can I do that?

My code looks similar to the Crosshair Demo 2 from the JFreeChart demos. But in this demo the range crosshair is not used. If you set
you can see my problem.

Thanks for your help!

Post Reply