jfreechart完整柱状图

jfreechart完整柱状图

ID:8959385

大小:18.93 KB

页数:6页

时间:2018-04-13

jfreechart完整柱状图_第1页
jfreechart完整柱状图_第2页
jfreechart完整柱状图_第3页
jfreechart完整柱状图_第4页
jfreechart完整柱状图_第5页
资源描述:

《jfreechart完整柱状图》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库

1、JFreechart完整柱状图importjava.io.IOException;publicclassAttendanceMain{publicstaticvoidmain(String[]args)throwsIOException{double[][]data=newdouble[][]{{100,96,98,95,99,100,92,93,91,94,96},{97,96,98,95,99,100,92,93,91,94,96},{97,96,98,95,99,100,92,93,91,94,96},{97,96,98,95,99,100,92,93,91,94,96}};Strin

2、g[]columnKeys={"测控1班","测控2班","信号1班","信号2班","信号3班","计通1班","计通2班","城轨1班","城轨2班","计应1班","计应2班"};String[]rowKeys={"2009级","2010级","2011级","2012级"};newAttendance(data,rowKeys,columnKeys);//at.setSubstring("第八周");}}importjava.awt.Color;importjava.awt.Font;importjava.awt.RenderingHints;importjava.io.FileO

3、utputStream;importjava.io.IOException;importorg.jfree.chart.ChartFactory;importorg.jfree.chart.ChartUtilities;importorg.jfree.chart.JFreeChart;importorg.jfree.chart.axis.AxisLocation;importorg.jfree.chart.axis.CategoryAxis;importorg.jfree.chart.axis.CategoryLabelPositions;importorg.jfree.chart.axis

4、.ValueAxis;importorg.jfree.chart.labels.StandardCategoryItemLabelGenerator;importorg.jfree.chart.plot.CategoryPlot;importorg.jfree.chart.plot.PlotOrientation;importorg.jfree.chart.renderer.category.BarRenderer;importorg.jfree.chart.title.TextTitle;importorg.jfree.data.category.CategoryDataset;impor

5、torg.jfree.data.general.DatasetUtilities;publicclassAttendance{/*privateStringsubtitle;publicvoidsetSubstring(Stringsub){subtitle=sub;}*/publicAttendance(double[][]data,String[]rowKeys,String[]columnKeys)throwsIOException{CategoryDatasetdataset=DatasetUtilities.createCategoryDataset(rowKeys,columnK

6、eys,data);JFreeChartchart=ChartFactory.createBarChart("计算机与通信工程系各班出勤率",//图表标题"班级",//目录轴的显示标签"出勤率(%)",//数值轴的显示标签dataset,//数据集PlotOrientation.VERTICAL,//图表方向:水平//PlotOrientation.HORIZONTAL,//图表方向:垂直true,false,false);//设置背景颜色chart.setBackgroundPaint(Color.cyan);CategoryPlotplot=chart.getCategoryPlot()

7、;BarRendererrender=(BarRenderer)plot.getRenderer();render.setBaseOutlinePaint(Color.red);//设置详细图表的显示细节部分的背景颜色plot.setBackgroundPaint(Color.lightGray);//设置垂直网格线颜色plot.setDomainGridlinePaint(Color.black);//设置

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。