Example usage for org.jfree.chart.plot PiePlot3D setDrawingSupplier

List of usage examples for org.jfree.chart.plot PiePlot3D setDrawingSupplier

Introduction

In this page you can find the example usage for org.jfree.chart.plot PiePlot3D setDrawingSupplier.

Prototype

public void setDrawingSupplier(DrawingSupplier supplier) 

Source Link

Document

Sets the drawing supplier for the plot and sends a PlotChangeEvent to all registered listeners.

Usage

From source file:userInterface.cdcRole.DecisionChartJPanel.java

private static JFreeChart createChart(PieDataset piedataset) {
    // System.out.println("1");
    JFreeChart jfreechart = ChartFactory.createPieChart3D("Top 5 States (For Vaccinations)", piedataset, true,
            false, false);//www. j  a  v  a2 s  . c  o  m
    PiePlot3D pieplot3d = (PiePlot3D) jfreechart.getPlot();
    pieplot3d.setDrawingSupplier(new ChartDrawingSupplier());
    pieplot3d.setStartAngle(270D);
    pieplot3d.setDirection(Rotation.ANTICLOCKWISE);
    pieplot3d.setForegroundAlpha(0.6F);
    return jfreechart;
}

From source file:com.pureinfo.srm.reports.impl.PieChartBuilder.java

/**
 * @throws PureException/*from w ww . j  a  v a  2 s.  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;
}