Adding a target line similar to value marker

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
karthikasok
Posts: 11
Joined: Thu Jul 13, 2006 11:38 am

Adding a target line similar to value marker

Post by karthikasok » Thu May 03, 2007 10:48 am

Hi,

Is there a way to add a target line in the chart.
I have my values on x-axis and the target moves from 2 to 10 in my timeseries chart.
The marker works only for constant target.
I need the Label features of the ValueMarker + a (start,end) target line.

Plz tell me how to proceed with this.

Thanks in advance,
Karthik
Last edited by karthikasok on Thu May 03, 2007 10:50 am, edited 1 time in total.

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

Post by david.gilbert » Thu May 03, 2007 10:49 am

If your target changes value, then it can be represented as a data series on the chart, plotted with a line renderer.
David Gilbert
JFreeChart Project Leader

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

karthikasok
Posts: 11
Joined: Thu Jul 13, 2006 11:38 am

Post by karthikasok » Thu May 03, 2007 10:59 am

Thanks for your quick reply.

Yes i can draw it using a LineRenderer. But i need to have the label as in a Marker.
Like if i have multiple charts and a target for each then i need to differentiate the
target for each chart.

So is there any other way.

Thanks,
Karthik

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

Post by david.gilbert » Thu May 03, 2007 11:25 am

You could add an annotation somewhere near the end of the target series.
David Gilbert
JFreeChart Project Leader

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

karthikasok
Posts: 11
Joined: Thu Jul 13, 2006 11:38 am

Post by karthikasok » Thu May 03, 2007 1:22 pm

Thanks,David.

I was able to use the Annotation very well.
I put the text near the last point of the target series
I have one problem. When i zoom in the annotation
text moves away from the last point. Can i avoid this
by any means?

Thanks,
Karthik

Locked