List of usage examples for org.jfree.chart.plot PiePlot3D setOutlineStroke
public void setOutlineStroke(Stroke stroke)
From source file:com.ewcms.plugin.report.generate.service.chart.ChartGenerationService.java
/** * 3D/* www .j a va 2s .c o m*/ * * @param title * @param titleFont * @param data ?? * @param order * @param legend * @param tooltips ???? * @param urls ??URL * @param urlGenerator * * @return */ public static JFreeChart create3DPieChart(String title, java.awt.Font titleFont, CategoryDataset data, TableOrder order, boolean legend, boolean tooltips, boolean urls, PieURLGenerator urlGenerator) { MultiplePiePlot plot = new MultiplePiePlot(data); plot.setDataExtractOrder(order); // plot.setOutlineStroke(null); JFreeChart pieChart = new JFreeChart(new PiePlot3D(null)); pieChart.setBackgroundPaint(null); plot.setPieChart(pieChart); PiePlot3D pp = (PiePlot3D) plot.getPieChart().getPlot(); pp.setBackgroundPaint(null); // pp.setInsets(new Insets(0, 5, 5, 5)); pp.setOutlineStroke(null); PieToolTipGenerator tooltipGenerator = null; if (tooltips) { tooltipGenerator = new StandardPieToolTipGenerator(); } if (!urls) { urlGenerator = null; } pp.setToolTipGenerator(tooltipGenerator); pp.setLabelGenerator(null); pp.setURLGenerator(urlGenerator); JFreeChart chart = new JFreeChart(title, titleFont, plot, legend); return chart; }
From source file:com.tonbeller.jpivot.chart.ChartFactory.java
/** * Creates a sample dataset for the demo. * // w ww . j ava 2 s. co m * @return A sample dataset. */ public static JFreeChart create3DPieChart(String title, java.awt.Font titleFont, CategoryDataset data, TableOrder order, boolean legend, boolean tooltips, boolean urls, PieURLGenerator urlGenerator) { MultiplePiePlot plot = new MultiplePiePlot(data); plot.setDataExtractOrder(order); //plot.setOutlineStroke(null); JFreeChart pieChart = new JFreeChart(new PiePlot3D(null)); pieChart.setBackgroundPaint(null); plot.setPieChart(pieChart); PiePlot3D pp = (PiePlot3D) plot.getPieChart().getPlot(); pp.setBackgroundPaint(null); //pp.setInsets(new Insets(0, 5, 5, 5)); // no outline around each piechart pp.setOutlineStroke(null); PieToolTipGenerator tooltipGenerator = null; if (tooltips) { tooltipGenerator = new StandardPieToolTipGenerator(); } if (!urls) { urlGenerator = null; } pp.setToolTipGenerator(tooltipGenerator); pp.setLabelGenerator(null); pp.setURLGenerator(urlGenerator); JFreeChart chart = new JFreeChart(title, titleFont, plot, legend); return chart; }
From source file:com.pureinfo.srm.reports.impl.PieChartBuilder.java
/** * @throws PureException//from w ww . j av a 2s. com * @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; }