问题
I am using JfreeChart to create dynamic charts. Currently, am facing a problem to create a Chart to show dynamic Date time values from database.
Showing above picture, I want to fix Y axis with months JAN to Dec.
Since long back trying , but I could not find any solution. Please give me the solution to fix above issue
回答1:
Use a DateAxis, like they show here, and format the labels for months.
DateAxis axis = (DateAxis) plot.getDomainAxis();
axis.setDateFormatOverride(new SimpleDateFormat("MMM"));
来源:https://stackoverflow.com/questions/40280364/jfreechart-dynamic-date-time-values-into-xy-chart