AxisTrace is not erased after showing a tooltip

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
lfkpoa
Posts: 7
Joined: Wed Dec 22, 2010 8:28 pm
antibot: No, of course not.

AxisTrace is not erased after showing a tooltip

Post by lfkpoa » Thu Dec 23, 2010 1:42 pm

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

barbarius
Posts: 74
Joined: Tue Jul 27, 2010 9:33 am
antibot: No, of course not.

Re: AxisTrace is not erased after showing a tooltip

Post by barbarius » Thu Dec 23, 2010 10:21 pm

is there an "AxisTrace" class in JFC?

lfkpoa
Posts: 7
Joined: Wed Dec 22, 2010 8:28 pm
antibot: No, of course not.

Re: AxisTrace is not erased after showing a tooltip

Post by lfkpoa » Fri Dec 24, 2010 1:05 pm

It's not a class but rather two different boolean properties of ChartPanel:

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;
I wrote just AxisTrace to mean both properties for a shorter subject.

Locked