Search code examples
jfreechart

JFreechart Gantt chart millisecond X axis?


I am using JFreechart to create a Gantt chart, however the Date (X-axis) is being displayed in the Date format HH:MM:SS.

Is there any way to get this x-axis to only display milliseconds? Since this is a Gantt chart my x-axis values are of type SimpleTimePeriod which I constructed with milliseconds.

Thank you very much for any help.


Solution

  • Assuming ChartFactory.createGanttChart(), you can specify any desired format when calling setNumberFormatOverride() on the plot's DateAxis. There's a related example here.