Change the unit of x axis in JFreeChart Gantt chart

前端 未结 1 1765
无人及你
无人及你 2020-12-22 03:35

I\'m a beginner in JFreeChart. I want to change the x axis values of this chart to milliseconds, with 5 ms intervals. I\'ve tried

axis.setTick         


        
相关标签:
1条回答
  • 2020-12-22 04:03

    Some possibilities to consider:

    • Specify the units in the corresponding axis label when creating the chart.

      "TIME (ms)", // range axis label
      
    • Use setDateFormatOverride() to change the format of the axis labels, e.g. three-digit values.

      DateAxis axis = (DateAxis) plot.getRangeAxis();
      axis.setDateFormatOverride(new SimpleDateFormat("SSS"));
      
    • Use setMaximumDate(), if warranted.

      axis.setMaximumDate(new Date(300));
      

    image

    0 讨论(0)
提交回复
热议问题