public class NoTransparencyCustomizer implements JRChartCustomizer{ @Override public void customize(JFreeChart chart, JRChart jrchart) { PiePlot plot = (PiePlot) chart.getPlot(); plot.setLabelShadowPaint(Color.GRAY); } }
PiePlot plot = (PiePlot) chart.getPlot(); plot.setLabelBackgroundPaint(null); plot.setLabelOutlinePaint(null); plot.setLabelShadowPaint(null);
/** * Creates a pie chart. * * @return A pie chart. */ private static JFreeChart createPieChart() { JFreeChart chart = ChartFactory.createPieChart(null, null, false, true, false); chart.setBackgroundPaint(Color.white); PiePlot plot = (PiePlot) chart.getPlot(); plot.setBackgroundPaint(null); plot.setInsets(RectangleInsets.ZERO_INSETS); plot.setInteriorGap(0.06); plot.setStartAngle(0.0); plot.setLabelGenerator(null); plot.setBaseSectionOutlinePaint(Color.white); plot.setBaseSectionOutlineStroke(new BasicStroke(1.2f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND)); plot.setOutlineVisible(false); plot.setLabelBackgroundPaint(null); plot.setLabelOutlinePaint(null); plot.setLabelShadowPaint(null); plot.setLabelPadding(RectangleInsets.ZERO_INSETS); plot.setLabelFont(new Font("Dialog", Font.PLAIN, 12)); plot.setLabelPaint(Color.gray); plot.setToolTipGenerator(new StandardPieToolTipGenerator("{2}")); return chart; }
plot.setLabelBackgroundPaint(Color.WHITE); plot.setLabelOutlinePaint(Color.gray.brighter()); plot.setLabelShadowPaint(Color.WHITE); plot.setLabelFont(ChartDefaults.defaultFont);
plot.setLabelBackgroundPaint(ChartDefaults.transparent); plot.setLabelOutlinePaint(Color.gray.brighter()); plot.setLabelShadowPaint(ChartDefaults.transparent); plot.setLabelFont(ChartDefaults.defaultFont);
pieplot.setLabelShadowPaint(findColor(labelShadowPaint));