PiePlot plot = (PiePlot) chart.getPlot(); plot.setLabelBackgroundPaint(null); plot.setLabelOutlinePaint(null); plot.setLabelShadowPaint(null);
pieplot.setLabelBackgroundPaint(new Color(220, 220, 220)); pieplot.setLegendLabelToolTipGenerator(new StandardPieSectionLabelGenerator("Tooltip for legend item {0}")); pieplot.setSimpleLabels(true);
public JFreeChart createPieChart(String title, PieDataset dataset) { JFreeChart chart = ChartFactory.createPieChart(title, dataset, true, true, false); PiePlot plot = (PiePlot) chart.getPlot(); plot.setCircular(true); plot.setDirection(Rotation.CLOCKWISE); plot.setNoDataMessage("No data to display"); StandardPieSectionLabelGenerator labelGenerator = new StandardPieSectionLabelGenerator("{0} {1} ({2})"); plot.setLabelGenerator(labelGenerator); plot.setInteriorGap(0.01); plot.setMaximumLabelWidth(0.32); Font font = new Font(chart.getLegend().getItemFont().getFamily(), Font.PLAIN, 12); plot.setLabelFont(font); plot.setLabelBackgroundPaint(new Color(220, 220, 220)); font = new Font(chart.getLegend().getItemFont().getFamily(), Font.PLAIN, 12); chart.getLegend().setItemFont(font); return chart; }
/** * 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.setLabelBackgroundPaint(ChartDefaults.transparent); plot.setLabelOutlinePaint(Color.gray.brighter()); plot.setLabelShadowPaint(ChartDefaults.transparent);
piePlot.setLabelBackgroundPaint(itemLabel.getBackgroundColor()); piePlot.setLabelBackgroundPaint(getChart().getBackcolor());
pieplot.setLabelBackgroundPaint(findColor(labelBackgroundPaint));
pie.setLabelPaint( pieDefinition.getLabelPaint() ); pie.setLabelBackgroundPaint( pieDefinition.getLabelBackgroundPaint() ); if ( pieDefinition.isLegendIncluded() ) { StandardPieSectionLabelGenerator labelGen = new StandardPieSectionLabelGenerator( "{0}" ); //$NON-NLS-1$
piePlot.setBaseSectionOutlineStroke(STROKE_NORMAL); piePlot.setLabelFont(WidgetUtils.FONT_SMALL); piePlot.setLabelBackgroundPaint(WidgetUtils.BG_COLOR_BRIGHT); piePlot.setLabelOutlineStroke(STROKE_NORMAL); piePlot.setLabelPaint(WidgetUtils.BG_COLOR_DARK);