1. 程式人生 > >Jfree 設定背景顏色,餅圖透明

Jfree 設定背景顏色,餅圖透明

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);