Can't access XYPlot data point behind XYBoxAnnotation

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
snoopygee
Posts: 18
Joined: Wed Jan 28, 2009 3:10 pm

Can't access XYPlot data point behind XYBoxAnnotation

Post by snoopygee » Thu Apr 23, 2009 11:46 am

Hi All,

When I add an XYBoxAnnotation to an XYPlot I can no longer access any data points which happen to be drawn within the same area, the XYBoxAnnotation seems to be drawn ontop of the data points. As I still need the mouse to be able to highlight and select these points I would like a method to be able to send the XYBoxAnnotation to the back (or something similiar) so that the data points remain in a state where I can still select them. Or is there a completely different way in which I can occomplish this?

Thanks in advance for your help.

Snoopygee

snoopygee
Posts: 18
Joined: Wed Jan 28, 2009 3:10 pm

Re: Can't access XYPlot data point behind XYBoxAnnotation

Post by snoopygee » Thu Apr 23, 2009 1:25 pm

OK seems as though I have found the solution.

Rather than using Annotations I can use a Domain Marker. This allows be to enforce a layer order so that the points appear above the Marker and remain selectable.

Cheers
Snoopygee

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Re: Can't access XYPlot data point behind XYBoxAnnotation

Post by david.gilbert » Sat Apr 25, 2009 8:10 am

If you add an annotation to the plot, it will be rendered against the primary axes and "above" the plot. As an alternative, you can add the annotation to a specific renderer, and then the annotation will be rendered using the axes that the renderer uses, and you have the option of specifying whether the annotation is rendered in a layer above or below the data points.

That said, I should probably introduce the layer option to the plot annotations as well.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

Locked