JfreeChart:将动态日期时间值转换为XY图表 [英] JfreeChart: dynamic Date time values into XY chart

查看:51
本文介绍了JfreeChart:将动态日期时间值转换为XY图表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用JfreeChart创建动态图表.当前,在创建图表以显示数据库中动态日期时间值时遇到了问题.

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.

如上图所示,我想用几个月的JAN到12月来固定Y轴.

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

推荐答案

使用此处所示,并设置标签格式一样几个月.

Use a DateAxis, like they show here, and format the labels for months.

DateAxis axis = (DateAxis) plot.getDomainAxis();
axis.setDateFormatOverride(new SimpleDateFormat("MMM"));

这篇关于JfreeChart:将动态日期时间值转换为XY图表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆