List of usage examples for org.jfree.chart.plot PiePlot3D setBaseSectionOutlinePaint
public void setBaseSectionOutlinePaint(Paint paint)
From source file:org.jfree.eastwood.ChartEngine.java
/** * Creates a pie chart with 3D effect./*w w w .java2s .c o m*/ * * @return A pie chart. */ private static JFreeChart createPieChart3D() { JFreeChart chart = ChartFactory.createPieChart3D(null, null, false, true, false); chart.setBackgroundPaint(Color.white); chart.setBorderPaint(Color.white); PiePlot3D plot = (PiePlot3D) chart.getPlot(); plot.setInsets(RectangleInsets.ZERO_INSETS); plot.setDarkerSides(true); plot.setBaseSectionOutlinePaint(new Color(0, 0, 0, 0)); plot.setStartAngle(0.0); plot.setInteriorGap(0.10); plot.setLabelGenerator(null); plot.setOutlineVisible(false); plot.setLabelBackgroundPaint(Color.white); plot.setLabelOutlinePaint(null); plot.setLabelShadowPaint(null); plot.setLabelPadding(RectangleInsets.ZERO_INSETS); plot.setLabelFont(new Font("Dialog", Font.PLAIN, 12)); plot.setLabelPaint(Color.darkGray); plot.setToolTipGenerator(new StandardPieToolTipGenerator("{2}")); return chart; }
From source file:com.pureinfo.srm.reports.impl.PieChartBuilder.java
/** * @throws PureException/*from ww w . j ava 2 s . co m*/ * @see com.pureinfo.srm.reports.IChartBuilder#draw(java.util.List, int) */ public JFreeChart buildChart() { Iterator result = m_datas.iterator(); DefaultPieDataset ds = getDataset(result); JFreeChart jfreechart = ChartFactory.createPieChart3D(null, ds, false, false, false); jfreechart.setBackgroundPaint(Color.WHITE); PiePlot3D pieplot3d = (PiePlot3D) jfreechart.getPlot(); pieplot3d.setOutlinePaint(Color.GRAY); pieplot3d.setOutlineStroke(new BasicStroke(1)); pieplot3d.setStartAngle(30D); pieplot3d.setDepthFactor(0.04); pieplot3d.setDrawingSupplier(new DefaultDrawingSupplier(MyPaintMgr.getPaints(), DefaultDrawingSupplier.DEFAULT_OUTLINE_PAINT_SEQUENCE, DefaultDrawingSupplier.DEFAULT_STROKE_SEQUENCE, DefaultDrawingSupplier.DEFAULT_OUTLINE_STROKE_SEQUENCE, DefaultDrawingSupplier.DEFAULT_SHAPE_SEQUENCE)); pieplot3d.setCircular(false); pieplot3d.setDirection(Rotation.CLOCKWISE); pieplot3d.setOutlinePaint(Color.WHITE); pieplot3d.setInteriorGap(.15); Color color = new Color(0xaa, 0xaa, 0xaa, 255); pieplot3d.setBaseSectionOutlinePaint(color); pieplot3d.setBaseSectionOutlineStroke(new BasicStroke(0)); pieplot3d.setForegroundAlpha(0.6f); pieplot3d.setLabelLinkStroke(new BasicStroke(1)); pieplot3d.setLabelOutlinePaint(new Color(0x777777)); pieplot3d.setLabelBackgroundPaint(new Color(0xf1f1f7)); pieplot3d.setLabelLinkPaint(new Color(0xaa, 0xaa, 0xaa, 60)); pieplot3d.setNoDataMessage("No data to display"); pieplot3d.setLabelShadowPaint(new Color(0xdddddd)); pieplot3d.setLabelFont(new Font("", Font.PLAIN, 10)); if (m_nType == TYPE_PERCENT) { pieplot3d.setLabelGenerator(new StandardPieItemLabelGenerator("{0} = {2}", NumberFormat.getNumberInstance(), PERCENT_NUMBER_FORMAT)); } fillChartInfo(ds); return jfreechart; }