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

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

Introduction

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

Prototype

public void setStartAngle(double angle) 

Source Link

Document

Sets the starting angle and sends a PlotChangeEvent to all registered listeners.

Usage

From source file:de.berlios.statcvs.xml.chart.AbstractPieChart.java

/**
 * @param filename/*from ww w.  j av  a2s  . c o m*/
 * @param title
 */
public AbstractPieChart(ReportSettings settings, String filename, String title) {
    super(settings, filename, title);

    dataset = new DefaultPieDataset();
    JFreeChart chart = ChartFactory.createPieChart3D(settings.getProjectName(), // chart title
            dataset, // data
            true, // include legend
            true, false);

    PiePlot3D plot = (PiePlot3D) chart.getPlot();
    plot.setStartAngle(270);
    plot.setDirection(Rotation.CLOCKWISE);
    plot.setForegroundAlpha(0.5f);
    //plot.setDepthFactor(0.2);
    plot.setDepthFactor(0.01);

    setChart(chart);
}

From source file:JFreeChartScriptlet.java

@Override
public void afterReportInit() throws JRScriptletException {
    DefaultPieDataset dataset = new DefaultPieDataset();
    dataset.setValue("Java", 43.2d);
    dataset.setValue("Visual Basic", 10.0d);
    dataset.setValue("C/C++", 17.5d);
    dataset.setValue("PHP", 32.5d);
    dataset.setValue("Perl", 1.0d);

    JFreeChart chart = ChartFactory.createPieChart3D("Pie Chart 3D Demo 1", dataset, true, true, false);

    PiePlot3D plot = (PiePlot3D) chart.getPlot();
    plot.setStartAngle(290);
    plot.setDirection(Rotation.CLOCKWISE);
    plot.setForegroundAlpha(0.5f);//  w  w w.  j a va  2s  . c om
    plot.setNoDataMessage("No data to display");

    /*   */
    this.setVariableValue("Chart", new JCommonDrawableRendererImpl(chart));
}

From source file:net.sf.jasperreports.samples.jfreechart.JFreeChartScriptlet.java

/**
 *
 *//*from   w  ww. j  a  v  a2s.c o  m*/
public void afterReportInit() throws JRScriptletException {
    DefaultPieDataset dataset = new DefaultPieDataset();
    dataset.setValue("Java", new Double(43.2));
    dataset.setValue("Visual Basic", new Double(10.0));
    dataset.setValue("C/C++", new Double(17.5));
    dataset.setValue("PHP", new Double(32.5));
    dataset.setValue("Perl", new Double(1.0));

    JFreeChart chart = ChartFactory.createPieChart3D("Pie Chart 3D Demo 1", dataset, true, true, false);

    PiePlot3D plot = (PiePlot3D) chart.getPlot();
    plot.setStartAngle(290);
    plot.setDirection(Rotation.CLOCKWISE);
    plot.setForegroundAlpha(0.5f);
    plot.setNoDataMessage("No data to display");

    /*   */
    this.setVariableValue("Chart", new JCommonDrawableRenderer(chart));
}

From source file:Controller.PieChart.java

/**
     * Creates a chart//from   ww  w  .j  av  a 2s .c  om
     */

private JFreeChart createChart(PieDataset dataset, String title) {

    JFreeChart chart = ChartFactory.createPieChart3D(title, // chart title
            dataset, // data
            true, // include legend
            true, false);

    PiePlot3D plot = (PiePlot3D) chart.getPlot();
    plot.setStartAngle(290);
    plot.setDirection(Rotation.CLOCKWISE);
    plot.setForegroundAlpha(0.5f);
    return chart;

}

From source file:app.view.panel.PanelCamembert.java

/**
 * Cre le graphique/*w w w. j  a v  a2s .  co m*/
 *
 * @param dataset Echantillon de donnes
 * @return Graphique
 */
private JFreeChart createChart(PieDataset dataset) {
    final JFreeChart chart = ChartFactory.createPieChart3D("Rpartition gographique", // chart title
            dataset, // data
            true, // include legend
            true, false);

    final PiePlot3D plot = (PiePlot3D) chart.getPlot();
    plot.setStartAngle(290);
    plot.setDirection(Rotation.CLOCKWISE);
    plot.setForegroundAlpha(0.9f);
    plot.setNoDataMessage("Unlucky donnes ://// gg rito");
    return chart;
}

From source file:org.mc.okapi.PieChart.java

public PieChart(String[] label, double[] value, String applicationTitle, String chartTitle) {
    super(applicationTitle);

    // This will create the dataset 

    DefaultPieDataset result = new DefaultPieDataset();

    for (int i = 0; i < label.length; i++) {
        result.setValue(label[i], value[i]);
    }//  w w  w. j a  v a 2  s  . c o  m
    PieDataset dataset = result;

    // based on the dataset we create the chart
    JFreeChart chart = ChartFactory.createPieChart3D(chartTitle, // chart title
            dataset, // data
            true, // include legend
            true, false);

    PiePlot3D plot = (PiePlot3D) chart.getPlot();
    plot.setStartAngle(290);
    plot.setDirection(Rotation.CLOCKWISE);
    plot.setForegroundAlpha(0.5f);

    // we put the chart into a panel
    ChartPanel chartPanel = new ChartPanel(chart);
    setIconImage(Toolkit.getDefaultToolkit().getImage("images/ico/extra/science_32.png"));
    // default size
    chartPanel.setPreferredSize(new java.awt.Dimension(500, 270));
    // add it to our application
    setContentPane(chartPanel);

}

From source file:org.shredzone.bullshitcharts.chart.AgreementPieGenerator.java

@Override
public Plot generate() {
    PieDatasetCreator dataset = new PieDatasetCreator();
    dataset.addChoice("disagree"); // TODO: i18n
    dataset.addChoice("indecisive");
    dataset.addChoice("agree");

    dataset.setFavouriteChoice("agree");
    dataset.setObnoxiousChoice("disagree");
    dataset.setTendency(getTendency());/*from  www  .j a v  a  2 s.c om*/

    PiePlot3D plot = new PiePlot3D(dataset.generate());
    plot.setCircular(true);
    plot.setStartAngle(110d);
    plot.setForegroundAlpha(0.6f);
    plot.setDarkerSides(true);
    plot.setOutlineVisible(false);
    return plot;
}

From source file:com.chris.brkopani.gui.analytics.Graph.java

/**
 * * Creates a chart/*from   w ww .j a  va  2 s .  c o m*/
 */
private JFreeChart createChart(PieDataset dataset, String title) {

    JFreeChart chart = ChartFactory.createPieChart3D(title, // chart title
            dataset, // data
            true, // include legend
            true, false);

    PiePlot3D plot = (PiePlot3D) chart.getPlot();
    plot.setStartAngle(290);
    plot.setSectionPaint("...-20", new Color(195, 203, 113));
    plot.setSectionPaint("21-30", new Color(174, 90, 65));
    plot.setSectionPaint("35-...", new Color(85, 158, 131));
    plot.setDirection(Rotation.CLOCKWISE);
    plot.setForegroundAlpha(0.5f);
    return chart;

}

From source file:org.jfree.chart.demo.PieChart3DDemo3.java

/**
 * Creates a sample chart./*from w ww  . java  2 s .c  om*/
 * 
 * @param dataset  the dataset.
 * 
 * @return A chart.
 */
private JFreeChart createChart(final PieDataset dataset) {

    final JFreeChart chart = ChartFactory.createPieChart3D("Pie Chart 3D Demo 3", // chart title
            dataset, // data
            true, // include legend
            true, false);

    final PiePlot3D plot = (PiePlot3D) chart.getPlot();
    plot.setStartAngle(290);
    plot.setDirection(Rotation.CLOCKWISE);
    plot.setForegroundAlpha(0.5f);
    plot.setNoDataMessage("No data to display");
    plot.setLabelGenerator(null);
    return chart;

}

From source file:reports.util.PieChart3DScriptlet.java

/**
 *
 *//*  w  ww .j av  a 2 s . c  om*/
public void afterReportInit() throws JRScriptletException {

    JFreeChart chart = ChartFactory.createPieChart3D("Pie Chart 3D Demo 1", dataset, true, true, false);

    PiePlot3D plot = (PiePlot3D) chart.getPlot();
    plot.setStartAngle(290);
    plot.setDirection(Rotation.CLOCKWISE);
    plot.setForegroundAlpha(0.5f);
    plot.setNoDataMessage("No data to display");

    /*   */
    this.setVariableValue("Chart", new JCommonDrawableRenderer(chart));
}