根据统计数据生成柱状统计图
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"); }
- 1
- 粉丝: 1
- 资源: 1
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- lcd1602 功能函数封装lcd1602-master.zip
- lcd1602基本驱动函数lcd1602-master.zip
- 2016-2018负荷天气data-quanzhou.xls
- FANUC机器人初始化系统的基本方法和步骤.docx
- 液体混合控制123.smart
- tcp/ip 实验,临时上传
- 艾默生PAC System3i PLC系列与其它设备TCP/IP通讯教程(不用其它网关,直接通讯,实用)
- 电力场景遥感数电杆塔检测数据集VOC+YOLO格式400张1类别.7z
- 九宫格数独游戏入门初级高级骨灰级完美.docx
- 网件 WG111 V3 网卡Windows10 /11 64位驱动