Custom Annotation Rescale..

Discussion about JFreeChart related to stockmarket charts.
Locked
smahamkl
Posts: 6
Joined: Fri Jul 03, 2009 12:23 am

Custom Annotation Rescale..

Post by smahamkl » Fri Jul 03, 2009 12:35 am

Hi,
I am trying to create a small stock chart tool using JFreeChart in which I am using the annotations capabilities that can be used to draw a Line, Text or other shapes on the chart. Also the great thing about these annotations are that they are rescaled appropriately when the chart is mouse zoomed in or out.

In the process I have had to create my own Custom annotation to draw an ARC annotation which is rendering fine on the chart. But the thing is that the arc is not getting scaled properly when the chart is zoomed in or out. What am I missing here? I have used the code XYLineAnnotation as the basis and followed the same struts like extending my XYArcAnnotations from XYAbstractAnnotation and implementing XYAnnotation interface overriding draw, equals, and other serialization methods. Can anyone suggest me what am I doing wrong?

thanks
SM

skunk
Posts: 1087
Joined: Thu Jun 02, 2005 10:14 pm
Location: Brisbane, Australia

Re: Custom Annotation Rescale..

Post by skunk » Fri Jul 03, 2009 2:28 pm

Did you try using one of these instead of rolling your own?

Code: Select all

org.jfree.chart.annotations.XYShapeAnnotation

smahamkl
Posts: 6
Joined: Fri Jul 03, 2009 12:23 am

Re: Custom Annotation Rescale..

Post by smahamkl » Fri Jul 03, 2009 3:24 pm

I have tried it but the shape is not being rendered properly.

Locked