JfreeChart: dynamic Date time values into XY chart

旧时模样 提交于 2019-12-31 07:41:34

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!