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

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

Introduction

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

Prototype

public void setLabelLinkStroke(Stroke stroke) 

Source Link

Document

Sets the link stroke and sends a PlotChangeEvent to all registered listeners.

Usage

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

/**
 * @throws PureException//from   w  ww.  j ava2 s  .  c  om
 * @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;
}