- 7
- 0
- 约1.06万字
- 约 15页
- 2017-10-07 发布于河南
- 举报
jfreechart 学习(JFreeChart学习)
jfreechart 学习(JFreeChart学习)
June 12, 2008
JFreeChart 学习
关键字: JFreeChart
Jfreechart目前最高版本为1.0.0版 (http: / / / JFreeChart / index. Html).可以绘制
饼图 柱状图 pie charts, bar charts, line and area charts曲线图 散列图 and bubble charts, Scatter Plots, Time Series 时序图 charts区域图, area difference chart差异图, STEP chart步骤图, multiple Axis 混合图 charts甘特图 charts, Gantt charts, 复合图 Combination
Jfreechart核心类库介绍:
Jfreechart主要由两个大的包组成: org.jfree.chart, org.jfree.data.其中前者主要与图形
本身有关, 后者与图形显示的数据有关.
核心类主要有:
Org.jfree.chart.jfreechart: 图表对象, 任何类型的图表的最终表现形式都是在该对象进行一些属性的定制.jfreechart引擎本身提供了一个工厂类用于创建不同类型的图表对象
Org.jfree.data.category.xxxdataset: 数据集对象, 用于提供显示图表所用的数据.根据不同类型的图表对应着很多类型的数据集对象类
Org.jfree.chart.plot.xxxplot: 图表区域对象, 基本上这个对象决定着什么样式的图表, 创建该对象的时候需要axis、renderer以及数据集对象的支持
Org.jfree.chart.axis.xxxaxis: 用于处理图表的两个轴: 纵轴和横轴
Org.jfree.chart.render.xxxrender: 负责如何显示一个图表对象
Org.jfree.chart.urls.xxxurlgenerator: 用于生成web图表中每个项目的鼠标点击链接
Tooltipgenerator 用于生成图象的帮助提示, 不同类型图表对应不同类型的工具提示类: XXXXX
对于常用的饼图阖柱状图, 比较简单而且网上有很多的文章介绍, 在这里就不再一一复述了,
(可以参考这篇文章http: / / / developerworks / CN / Java / L - JFreeChart / index. Html? CA = dwcn - ISC ccid = i)
主要说明下另一种常见的报表, 时序图, 首先声明一个曲线数据集合对象和曲线对象
Timeperiodvaluescollection timeseriescollection = New timeperiodvaluescollection ();
/ / 声明具体是曲线对象 (可根据实际情况在同一张图中显示多条曲线进行数据比对, 根据实际应用情况当超过4条曲线时, 就会有些乱.)
Timeperiodvalues timeperiod1 = New timeperiodvalues (服务器a在线用户数量);
Timeperiodvalues timeperiod2 = New timeperiodvalues (服务器b在线用户数量);
我在使用timeseriescollection = New timeseriescollection (TSC);
TimeSeries TS = new timeseries ();
在生成数据集时 (ts.add (New Day (Day, month, Year), 10) 只能生成最小单位为天的横轴所以改用了timeperiodvaluescollection
/ / 根据当前时间取得横轴坐标, 时间间隔为1小时
Cal = calendar.getinstance (Calendar);
Int year = cal.get (calendar.year);
Int month = cal.get (calendar.month) + 1;
Cal.get day = Int (calendar.day _ of _ month);
/ / 这里改为根据自己程序得到的需要显示的时间点和对应的数据的集合;
Objectlist1 = dao.getlist1 (List);
Objectlist2 = dao.getlist2 (List);
/ / 使用循环, 把x轴, y轴的值赋给timeseries1
For (int i = 0; I objecthash1.size (); I +
您可能关注的文档
- 2009年普通高等学校招生全国统一考试(广东卷)(National unified examination for general institutions of higher learning (Guangdong roll) in 2009).doc
- 2010年中考数学真题分类汇编专题29 尺规作图(In 2010 29 compilation of thematic classification of senior high school entrance examination mathematics exam ruler).doc
- 2010年全国自考基础会计学模拟试卷(七)(2010 national self taught basic accounting simulation paper (seven)).doc
- 2010gaokaoti(2010gaokaoti).doc
- 2010年中考复习整理初一初二思品练习卷(2010 exam review, finishing the first two days of thinking quality exercises).doc
- 2010年广州中考数学模拟试题八(In 2010, Guangzhou high school mathematics simulation test questions eight).doc
- 2010.06.03材质笔记(2010.06.03 material notes).doc
- 2010年度感动中国十大人物事迹及颁奖词(Deeds and awards speech of moving China's ten great figures in 2010).doc
- 2010年拆迁办上半年总结和下半年工作重点(2010 demolition work in the first half of the summary and focus of the second half of the work).doc
- 2010年基本能力试题特点(Basic ability examination questions in 2010).doc
- jd1104二阶段小考(The two stage jd1104 quiz).doc
- jsp多页注册教学(JSP multi page registration instruction).doc
- js 操作select 下拉框(JS操作选择下拉框).doc
- js判断大全(JS judgment book).doc
- js图片不间断滚动代码(JS picture scroll code uninterrupted).doc
- js数据验证(JS data validation).doc
- js这2个星期的总结都交了(JS, the sum of the 2 weeks has been handed in).doc
- java正则表达式入门(Introduction to Java regular expressions).doc
- kd战法(KD tactics).doc
- js中表单验证常用到的正则表达式(Regular expressions used in form validation in JS).doc
最近下载
- 硅酸盐水泥熟料的煅烧工艺课件.ppt VIP
- 2024-2025学年小学信息技术(信息科技)甘肃版2023四年级下册教学设计合集.docx VIP
- 武汉体育学院2020年硕士研究生入学考试(体育教育训练学)真题.pdf VIP
- 25秋一上数学九大专项练习期末复习(75页).docx VIP
- 计划开竣工日期和施工进度的网络图.doc VIP
- 水泥工艺生产熟料煅烧技术.pptx VIP
- DB34T 5121-2025社会化医疗消毒供应服务规范.docx VIP
- 呼吸性碱中毒.pptx
- 土地翻犁协议.docx VIP
- 2024-2025学年小学信息技术(信息科技)甘肃版2023五年级下册教学设计合集.docx VIP
原创力文档

文档评论(0)