Hi,
I would like to enable a crosshair that changes with the mouse and not only when the chart is clicked.
The simplest way seems to be to use HorizontalAxisTrace and VerticalAxisTrace.
It works fine until a tooltip is shown.
In that case the last trace drawn is not removed.
Seems like a bug in the paint strategy used by JFreeChart.
It would be nice also to have a tick label drawn exactly at the crosshair value for each axis (following the mouse), using a background colour.
Is there a simple way to do this?
Any suggestion how to get started?
With regards,
Luis Fernando
AxisTrace is not erased after showing a tooltip
Re: AxisTrace is not erased after showing a tooltip
is there an "AxisTrace" class in JFC?
Re: AxisTrace is not erased after showing a tooltip
It's not a class but rather two different boolean properties of ChartPanel:
I wrote just AxisTrace to mean both properties for a shorter subject.
Code: Select all
/** A flag that controls whether or not horizontal tracing is enabled. */
private boolean horizontalAxisTrace = false;
/** A flag that controls whether or not vertical tracing is enabled. */
private boolean verticalAxisTrace = false;