`
lizhou
  • 浏览: 108270 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

jfreechart 去除灰色背景

    博客分类:
  • java
 
阅读更多
JFreeChart chart = ChartFactory.createPieChart3D("", dataset, false, false, false);
// 设置外层图片 无边框 无背景色 背景图片透明	
chart.setBorderVisible(false);
chart.setBackgroundPaint(null);
chart.setBackgroundImageAlpha(0.0f);

PiePlot3D plot = (PiePlot3D) chart.getPlot();

// 饼图的0°起点在3点钟方向,设置为180°是从左边开始计算旋转角度
plot.setStartAngle(180);
// 扇形的旋转方向
plot.setDirection(Rotation.CLOCKWISE);
// 饼图上 无标签提示
plot.setLabelGenerator(null);
// 饼图的透明度
plot.setForegroundAlpha(0.5f);
// 饼图的背景全透明
plot.setBackgroundAlpha(0.0f);
// 去除背景边框线
plot.setOutlinePaint(null);

 

jfreechart 最终显示的报表是由多层图片叠加的。所以去除灰色的关键就是,把饼层的背景设置为全透明。个人理解:饼层和背景构成了饼图,饼图加背景构成了饼图报表。

 

分享到:
评论
1 楼 gy090028 2016-04-27  
受教了 

相关推荐

Global site tag (gtag.js) - Google Analytics