Two questions about value markers

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
chunkyks
Posts: 8
Joined: Sat Sep 24, 2011 2:56 am
antibot: No, of course not.

Two questions about value markers

Post by chunkyks » Thu Oct 17, 2013 2:11 am

Afternoon,

I'm having a hard time doing two things with value markers, I'm hoping someone can point me in the right direction:

1) On an XYPlot with two range axes, I'm trying to add a valuemarker to the second range axis, but I can't figure out what combination of UI elements to call; the only "addRangerMarker" methods available don't appear to include an axis to reference.

2) On the same plot, I've replaced the X axis with a DateAxis. I'm trying to put a marker on that axis, too, but so far have not been able to figure out how do that at all. The series I'm using is a TimeSeries using org.jfree.data.time.Month class, and I'd like to put a marker on a particular Month.

Thanks!
Gary

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

Re: Two questions about value markers

Post by david.gilbert » Fri Oct 18, 2013 9:50 am

For (1), you should use this method and specify the index of a dataset that is mapped to the axis you want the marker to apply to:

http://www.jfree.org/jfreechart/api/jav ... .ui.Layer)

For (2), you need to specify the value of the marker in milliseconds since 1-Jan-1970 (you could create an instance of the required Month then call the getMiddleMillisecond() method).
David Gilbert
JFreeChart Project Leader

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

chunkyks
Posts: 8
Joined: Sat Sep 24, 2011 2:56 am
antibot: No, of course not.

Re: Two questions about value markers

Post by chunkyks » Fri Oct 18, 2013 10:16 pm

That's perfect, thank-you.

Gary

Locked