文件名称:根据统计数据生成柱状统计图
文件大小:6KB
文件格式:RAR
更新时间:2012-07-23 04:56:01
JfreeChart
public void graphicsGeneration(int h1, int h2, int h3, int h4, int h5) { final int X = 10; int imageWidth = 300;// ͼƬ�Ŀ�� int imageHeight = 300;// ͼƬ�ĸ߶� int columnWidth = 30;// ��Ŀ�� int columnHeight = 200;// ������߶� ChartGraphics chartGraphics = new ChartGraphics(); chartGraphics.image = new BufferedImage(imageWidth, imageHeight, BufferedImage.TYPE_INT_RGB); Graphics graphics = chartGraphics.image.getGraphics(); graphics.setColor(Color.white); graphics.fillRect(0, 0, imageWidth, imageHeight); graphics.setColor(Color.blue); graphics.fill3DRect(X + 1 * columnWidth, columnHeight - h1, columnWidth,h1,true); graphics.setColor(Color.red); graphics.fill3DRect(X + 2 * columnWidth, columnHeight - h2, columnWidth, h2,true); graphics.setColor(Color.yellow); graphics.fill3DRect(X + 3 * columnWidth, columnHeight - h3, columnWidth, h3,true); graphics.setColor(Color.green); graphics.fill3DRect(X + 4 * columnWidth, columnHeight - h4, columnWidth, h4,true); graphics.setColor(Color.orange); graphics.fill3DRect(X + 5 * columnWidth, columnHeight - h5, columnWidth, h5,true); graphics.setColor(Color.cyan); //chartGraphics.createImage("E:\\MyEclipse\\apache-tomcat-6.0.14\\webapps\\pic\\chart.jpg"); }
【文件预览】:
pic
----.project(1KB)
----.myumldata(66B)
----.settings()
--------org.eclipse.core.resources.prefs(106B)
----.mymetadata(282B)
----WebRoot()
--------picture.jsp(510B)
--------WEB-INF()
--------META-INF()
----.myeclipse()
----src()
--------org()
----.classpath(340B)