I am able to display gantt charts (with/without progress) but I want to draw today's line inbetween the graph. How do I do it?
Ex: In MS Project, when you see the gantt chart, you can see axis drawn which represents today's date. By looking at it, you are able to understand the graph more clearly.
Please revert back to me in case of more explanation.
Thanks in advance.
How to show today's line in Gantt chart?
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Use the addRangeMarker() method to add a ValueMarker to the plot. The value for the marker should be the milliseconds since 1-Jan-1970 for "right now" (e.g. new java.util.Date().getTimeInMillis()).
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
Re: How to show today's line in Gantt chart?
Dave,
Do you mean use addDomainMarker or have I missed something?
Thanks
Brett
Do you mean use addDomainMarker or have I missed something?
Thanks
Brett
-
- Posts: 513
- Joined: Wed Sep 12, 2007 3:18 pm
Re: How to show today's line in Gantt chart?
The ChartFactory.createGanttChart() method specifies a CategoryAxis for the domain and a DateAxis for the range, so a range marker seems appropriate. PlotOrientation.HORIZONTAL may be the missing piece.
Code: Select all
CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, dateAxis, renderer);
plot.setOrientation(PlotOrientation.HORIZONTAL);