hi
i am trying to add marker on domain axis i.e. x-axis , which is of type day in my case.
-- my snippet of code in chart processor--
XYPlot plot = (XYPlot) jfc.getPlot();
Day day = new Day(11,02,2006);
Marker m3 = new ValueMarker(day.getSerialIndex());
plot.addDomainMarker(m3);
But this does not give any marker on my chart.
Is there any marker where i can give day as input rather than a double??
Any clue??
Varun Ahluwalia.
how to add Domain Markers on X-axis (Day axis)?
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
The getSerialIndex() method in the Day class returns an integer that is almost the same as the value used to represent dates in spreadsheets like Excel and Lotus 1-2-3.
The ValueMarker constructor expects a value which, for a DateAxis, should be specified in milliseconds since 1-Jan-1970 (like java.util.Date).
So that is the problem...you are not creating your ValueMarker with the correct value.
The ValueMarker constructor expects a value which, for a DateAxis, should be specified in milliseconds since 1-Jan-1970 (like java.util.Date).
So that is the problem...you are not creating your ValueMarker with the correct value.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


Have you tried this?
Code: Select all
(double)DateUtilities.createDate(2006, 2, 11).getTime();