日期:2014-05-18 浏览次数:20769 次
/*---------设置状态条颜色的深浅渐变-----------*/
GradientPaint gp0 = new GradientPaint(0.0f, 0.0f, new Color(255,200, 80), 0.0f, 0.0f, new Color(255, 255, 40)); GradientPaint gp1 = new GradientPaint(0.0f, 0.0f, new Color(50,255, 50), 0.0f, 0.0f, new Color(100, 255, 100)); GradientPaint gp2 = new GradientPaint(0.0f, 0.0f, Color.red, 0.0f,0.0f, new Color(255, 100, 100)); GradientPaint gp3 = new GradientPaint(0.0f, 0.0f, new Color(108,108, 255), 0.0f, 0.0f, new Color(150, 150, 200)); renderer.setSeriesPaint(0, gp0); renderer.setSeriesPaint(1, gp1); renderer.setSeriesPaint(2, gp2); renderer.setSeriesPaint(3, gp3);
/*---------设置状态条颜色的深浅渐变-----------*/
GradientPaint gp0 = new GradientPaint(0.0f, 0.0f, new Color(255,200, 80), 0.0f, 0.0f, new Color(255, 255, 40));
GradientPaint gp1 = new GradientPaint(0.0f, 0.0f, new Color(50,255, 50), 0.0f, 0.0f, new Color(100, 255, 100));
GradientPaint gp2 = new GradientPaint(0.0f, 0.0f, Color.red, 0.0f,0.0f, new Color(255, 100, 100));
GradientPaint gp3 = new GradientPaint(0.0f, 0.0f, new Color(108,108, 255), 0.0f, 0.0f, new Color(150, 150, 200));
renderer.setSeriesPaint(0, gp0);
renderer.setSeriesPaint(1, gp1);
renderer.setSeriesPaint(2, gp2);
renderer.setSeriesPaint(3, gp3);
//JFreeChart对象
JFreeChart chart = ChartFactory.createStackedBarChart(
chartTitle, //图表标题
xName, //目录轴的显示标签
yName, //数值轴的显示标签
dataset, //数据集
PlotOrientation.VERTICAL, //图表方向:水平、垂直
true, //是否显示图例
false, //是否生成工具
false //是否生成URL链接
);