哪种JFreeChart最容易用于表示简单的折线图和条形图 [英] Which JFreeChart is the easiest to use for representing simple line and bar charts

查看:58
本文介绍了哪种JFreeChart最容易用于表示简单的折线图和条形图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在图表中表示的数据通常会沿着底部或x轴显示时间戳记(日期和时间),以及各种数据(它们始终是简单的整数,或者可能是浮动数据)未来).基本上,它将沿着底部映射事件,例如沿左侧映射性能.

The data I am trying to represent in my charts will usually be shown with timestamps (dates and times) going along the bottom, or x axis, and a variety of data (which will always be simple integers or maybe float data in the future) shown on the left axis. Basically it will be mapping events along the bottom, and say, performance along the left.

我正在使用JFreeChart,但是不幸的是,不存在对开发人员的支持,我不会为他们的教程付费.我马上就可以看到许多可以使用的图表类型,这篇文章要求我使用最合适的集合和图表对象.

I am using JFreeChart, however unfortunately the support for developers is non-existent, and I will not be paying for their tutorials. Straight away I can see many chart types which I could use, this post is asking for the most suitable collection and chart object for me to use.

最初,我使用XYScatterPlot选择了XYDataSet,但是我意识到其中一个轴必须是日期,而不是简单的整数.所以我只是看了一下TimeSeries和TimeSeriesChart对象.但是由于某种奇怪的原因,它似乎只允许布尔值或浮点数(数字轴上不允许整数值).也是说我的Timestamp类已弃用(我使用的所有日期信息都作为时间戳存储在对象数据库中,并存储年,月,日,时,分,秒等.)

Originally I went for XYDataSet with XYScatterPlot, but I realise one of the axes must be a date, not a simple integer. So I just had a look at TimeSeries and TimeSeriesChart objects. However for some odd reason it only seems to allow boolean or float (not integer values on the number axis). Also it's saying my Timestamp class is deprecated (all the date information I am using is stored in an object database as timestamps, storing year, month, day, hour, minute, second etc.).

因此,总而言之,我希望最好的集合和图表对象存储一系列简单的图形,这些图形将时间戳记日期映射到整数值. 干杯.

So in summary, I want the best collection and chart object to store a simple series of graphs mapping a timestamp date to integer values. Cheers.

推荐答案

虽然我推荐指南 (针对专业开发人员,学生和爱好者)将要检查现存的示例和来源.分发中包含的org.jfree.chart.demo.TimeSeriesChartDemo1与您的用例特别相关,并且相关的

While I recommend the guide for professional developers, students and afficionados will want to examine the extant examples and source. org.jfree.chart.demo.TimeSeriesChartDemo1, included in the distribution, is particularly relevant to your use case, and the associated createTimeSeriesChart() methods of ChartFactory show how such a chart is constructed using a DateAxis.

免责声明:不隶属于Object Refinery Limited;只是一个满意的客户,贡献很小.

这篇关于哪种JFreeChart最容易用于表示简单的折线图和条形图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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