Hi,
I have a problem deleting annotations that I've added on a LineAndShape or Step renderer.
plot.clearAnnotations() works fine for annotations added with the plot.addAnnotation(annotation) method.
When added with renderer.addAnnotation(annotation) method calling clearAnnotations on the plot does nothing. Which seems reasonable... but how do I clear annotations added on the renderer?
Thanks
Stelios
Clear annoations added on Renderer
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
It seems the equivalent to clearAnnotations() in the renderer is removeAnnotations(). I think I will rename it for consistency.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


Can't believe I didn't see that, its clear enough in any case...
btw I noticed in the XYTextAnnotation if you put a carriage return it does have effect but you can't see the line that goes under. Is there any standard way to overcome this, do I need to override the XYTextAnnotation class?
thanks
stelios
btw I noticed in the XYTextAnnotation if you put a carriage return it does have effect but you can't see the line that goes under. Is there any standard way to overcome this, do I need to override the XYTextAnnotation class?
thanks
stelios
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Attaching annotations to a particular renderer is just a way of enabling annotations to be plotted against secondary axes. The annotations attached to the plot are always plotted against the primary axes.nubiste wrote:Is there any advantage on adding the annotation on the renderer instead of the plot. Both seem to work fine, is the only difference the event they fire?
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader

