jfreechart 颜色设置问题..

浪漫小和 2013-03-14 01:36:33


他就是这个图片下面这一层的颜色如何设置,也就是图片最左边的那颜色,现在看着稍微有那么点灰
如何换成其他颜色?
就是0.00000这层的颜色..
...全文
153 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
浪漫小和 2013-03-14
  • 打赏
  • 举报
回复
还有就是如何设置按照 #7299c4 这样的值来设置?
public class ZhuZhuang extends ApplicationFrame { public ZhuZhuang(String s) { super(s); setContentPane(createDemoBar()); } // 生成显示图表的面板 public static JPanel createDemoBar() { JFreeChart jfreechart = createChart(createDataset()); return new ChartPanel(jfreechart); } // 生成图表主对象JFreeChart public static JFreeChart createChart(CategoryDataset dataset) { JFreeChart chart = ChartFactory.createBarChart3D("水果销量统计图", //建立3D柱状图 "水果",//横轴名称 "销量",//纵轴名称 dataset,//数据集 PlotOrientation.VERTICAL,//纵向显示 true,//显示每个颜色柱子的柱名 false, false); CategoryPlot plot = chart.getCategoryPlot();//设置图的高级属性 BarRenderer3D renderer = new BarRenderer3D();//3D属性修改 renderer.setBaseOutlinePaint(Color.BLACK);//设置边框颜色为black renderer.setWallPaint(Color.gray); //设置wall的颜色为gray renderer .setItemLabelGenerator(new StandardCategoryItemLabelGenerator());//设置柱顶数据,API中居然没有StandardCategoryItemLabelGenerator这个类 //renderer.setItemLabelFont(new Font("黑体",Font.PLAIN,12));//设置柱顶数据字体 renderer.setItemLabelsVisible(true);//打开ItemLabel开关 plot.setRenderer(renderer);//将修改后的属性值保存到图中 plot.setForegroundAlpha(0.6f);//柱的透明度 return chart; } // 生成数据 public static CategoryDataset createDataset() { double[][] data = new double[][] { { 672, 766, 223, 540, 126 }, { 325, 521, 210, 340, 106 }, { 332, 256, 523, 240, 526 } };// 设置数据 String[] rowKeys = { "苹果", "梨子", "葡萄" };// 行标志 String[] columnKeys = { "北京", "上海", "广州", "成都", "深圳" };// 列标志 CategoryDataset linedataset = DatasetUtilities.createCategoryDataset( rowKeys, columnKeys, data); // 建立数据集 return linedataset; } public static void main(String[] args) { ZhuZhuang fjc = new ZhuZhuang("柱状图"); fjc.pack(); RefineryUtilities.centerFrameOnScreen(fjc); fjc.setVisible(true); } }

62,612

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧