But how if i want to add the marker to the RangeAxis of a gantt chart (the range axis is in date timemillis ..) ? Is it possible to use addRangeMarker() instead of addDomainMarker() in the CategoryPlot ? I've tried the following code, with no error, and also no intended result with the marker, the marker just doesnt show up. Here's an excerpt of my code :
Code: Select all
chart = createChart(dataset);
CategoryPlot plot = (CategoryPlot) chart.getPlot();
Day day = new Day(1, 4, 2001);
CategoryMarker marker = new CategoryMarker(new Long(day.getFirstMillisecond()), Color.blue,
new BasicStroke(1.0f));
marker.setDrawAsLine(true);
marker.setLabel("Marker Label");
marker.setLabelFont(new Font("Dialog", Font.PLAIN, 11));
marker.setLabelTextAnchor(TextAnchor.TOP_RIGHT);
marker.setLabelOffset(new RectangleInsets(2, 5, 2, 5));
plot.addRangeMarker(marker, Layer.BACKGROUND);
