Example usage for org.jfree.util Rotation ANTICLOCKWISE

List of usage examples for org.jfree.util Rotation ANTICLOCKWISE

Introduction

In this page you can find the example usage for org.jfree.util Rotation ANTICLOCKWISE.

Prototype

Rotation ANTICLOCKWISE

To view the source code for org.jfree.util Rotation ANTICLOCKWISE.

Click Source Link

Document

The reverse order renders the primary dataset first.

Usage

From source file:org.codehaus.mojo.dashboard.report.plugin.chart.PieChart3DRenderer.java

public void createChart() {
    PieDataset dataset = (PieDataset) this.datasetStrategy.getDataset();
    report = ChartFactory.createPieChart3D(this.datasetStrategy.getTitle(), dataset, false, true, true);

    PiePlot3D plot3D = (PiePlot3D) report.getPlot();
    plot3D.setDirection(Rotation.ANTICLOCKWISE);
    plot3D.setStartAngle(PieChart3DRenderer.START_ANGLE);
    plot3D.setForegroundAlpha(PieChart3DRenderer.FOREGROUND_ALPHA);
    plot3D.setLabelFont(new Font("Lucida", 0, PieChart3DRenderer.FONT_SIZE));

}

From source file:org.codehaus.mojo.dashboard.report.plugin.chart.PieChartRenderer.java

public void createChart() {

    PieDataset dataset = (PieDataset) this.datasetStrategy.getDataset();
    report = ChartFactory.createPieChart(this.datasetStrategy.getTitle(), dataset, true, true, false);
    PiePlot plot = (PiePlot) report.getPlot();
    //        plot.setCircular( false );
    plot.setDirection(Rotation.ANTICLOCKWISE);
    /*/*from w  w  w.j av  a2  s .  co  m*/
     * plot.setExplodePercent(0, 0.15D); plot.setExplodePercent(1, 0.15D);
     */
    //        plot.setInteriorGap( PieChartRenderer.INTERIOR_GAP );
    plot.setLabelFont(new Font("Lucida", 0, PieChartRenderer.FONT_SIZE));
    plot.setLabelGap(PieChartRenderer.LABEL_GAP);
    plot.setNoDataMessage("No data available");
    plot.setStartAngle(PieChartRenderer.START_ANGLE);
    Paint[] paints = this.datasetStrategy.getPaintColor();

    for (int i = 0; i < dataset.getItemCount() && i < paints.length; i++) {
        plot.setSectionPaint(dataset.getKey(i), paints[i]);
    }
}

From source file:BrowserAverage.java

private JFreeChart createChart(PieDataset dataset, String title) {
    JFreeChart chart = ChartFactory.createPieChart3D(title, dataset, true, true, false);
    PiePlot3D plot = (PiePlot3D) chart.getPlot();
    plot.setStartAngle(0);//from   w  w  w . ja v  a  2 s .com
    plot.setDirection(Rotation.ANTICLOCKWISE);
    plot.setForegroundAlpha(0.5f);
    rotator = new Rotator(plot, 0);
    rotator.start();
    return chart;
}

From source file:userInterface.StateAdminRole.DecisionChartJPanel.java

private static JFreeChart createChart(PieDataset piedataset) {
    JFreeChart jfreechart = ChartFactory.createPieChart3D("Top 5 Vaccines", piedataset, true, false, false);
    PiePlot3D pieplot3d = (PiePlot3D) jfreechart.getPlot();
    pieplot3d.setStartAngle(270D);// ww  w  . j a  va 2  s  .c  o m
    pieplot3d.setDirection(Rotation.ANTICLOCKWISE);
    pieplot3d.setForegroundAlpha(0.6F);
    return jfreechart;
}

From source file:edu.ucla.stat.SOCR.chart.demo.PieChart3DDemo2.java

/**
 * Creates a demo chart.//from  w w w .j av a 2  s .  co m
 * 
 * @param dataset  the dataset.
 * 
 * @return A chart.
 */
protected JFreeChart createChart(PieDataset dataset) {
    // create the chart...
    JFreeChart chart = ChartFactory.createPieChart3D(chartTitle, // chart title
            dataset, // dataset
            !legendPanelOn, // include legend
            false, false);

    PiePlot3D plot = (PiePlot3D) chart.getPlot();
    plot.setStartAngle(270);
    plot.setDirection(Rotation.ANTICLOCKWISE);
    plot.setForegroundAlpha(0.60f);
    plot.setInteriorGap(0.05); // 0.33 used to work with JFreeChart 1.0.05

    for (int i = 0; i < pulloutFlag.length; i++) {
        //System.out.println("\""+pulloutFlag[i]+"\"");
        if (pulloutFlag[i].equals("1")) {
            Comparable key = dataset.getKey(i);
            plot.setExplodePercent(key, 0.30);
        }
    }

    if (rotateOn) {
        Rotator rotator = new Rotator(plot);
        rotator.start();
    }

    setCategorySummary(dataset);
    return chart;
}

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

/**
 * Creates a new demo.//from  w ww.j ava 2 s . c  o m
 *
 * @param title  the frame title.
 */
public PieChart3DDemo2(final String title) {

    super(title);

    // create a dataset...
    final DefaultPieDataset data = new DefaultPieDataset();
    data.setValue("Java", new Double(43.2));
    data.setValue("Visual Basic", new Double(10.0));
    data.setValue("C/C++", new Double(17.5));
    data.setValue("PHP", new Double(32.5));
    data.setValue("Perl", new Double(12.5));

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

    chart.setBackgroundPaint(Color.yellow);
    final PiePlot3D plot = (PiePlot3D) chart.getPlot();
    plot.setStartAngle(270);
    plot.setDirection(Rotation.ANTICLOCKWISE);
    plot.setForegroundAlpha(0.60f);
    plot.setInteriorGap(0.33);
    // add the chart to a panel...
    final ChartPanel chartPanel = new ChartPanel(chart);
    chartPanel.setPreferredSize(new java.awt.Dimension(500, 270));
    setContentPane(chartPanel);

    final Rotator rotator = new Rotator(plot);
    rotator.start();

}

From source file:org.gvsig.symbology.fmap.symbols.PieChart3DSymbol.java

protected Plot getOutlinePlot() {
    if (outlinePlot == null) {
        PiePlot3D myMapPlot = new PiePlot3D();

        myMapPlot.setLabelGap(0);//w ww. j  a v  a 2s.  c  o m
        myMapPlot.setIgnoreZeroValues(ignoreZeroValues);

        updateDataset();

        myMapPlot.setDataset(new DefaultPieDataset(dataset));
        myMapPlot.setDirection(clockwise ? Rotation.CLOCKWISE : Rotation.ANTICLOCKWISE);
        myMapPlot.setDepthFactor(depthFactor);
        myMapPlot.setMinimumArcAngleToDraw(minimumAngleToDraw);
        myMapPlot.setCircular(circular);
        myMapPlot.setStartAngle(getRotation());
        /*
         * myMapPlot.setDarkerSides(false); // requires jfreechart 1.0.10
         * myMapPlot.setForegroundAlpha(foregroundAlpha); // requires
         * jfreechart 1.0.10
         */
        outlinePlot = myMapPlot;
    }
    return outlinePlot;
}

From source file:net.sf.dynamicreports.test.jasper.chart.SpiderChartTest.java

@Override
public void test() {
    super.test();

    numberOfPagesTest(1);/*from  w  w w  . j  a va2s  .co m*/

    JRPrintFrame printFrame = (JRPrintFrame) getElementAt("summary.list1", 0);

    JRPrintImage image = (JRPrintImage) printFrame.getElements().get(0);
    JFreeChart chart = getChart(image);
    SpiderWebPlot plot = (SpiderWebPlot) chart.getPlot();
    Assert.assertEquals("max value", 10d, plot.getMaxValue());
    Assert.assertEquals("rotation", Rotation.ANTICLOCKWISE, plot.getDirection());
    Assert.assertEquals("table order", org.jfree.util.TableOrder.BY_COLUMN, plot.getDataExtractOrder());
    Assert.assertFalse("web filled", plot.isWebFilled());
    Assert.assertEquals("start angle", 20d, plot.getStartAngle());
    Assert.assertEquals("head percent", 30d, plot.getHeadPercent());
    Assert.assertEquals("interior gap", 0.15d, plot.getInteriorGap());
    Assert.assertEquals("axis line color", Color.RED, plot.getAxisLinePaint());
    Assert.assertEquals("interior gap", 2f, ((BasicStroke) plot.getAxisLineStroke()).getLineWidth());
    Assert.assertEquals("label color", Color.BLUE, plot.getLabelPaint());
    Assert.assertEquals("label gap", 2d, plot.getAxisLabelGap());
    Assert.assertTrue("label font", plot.getLabelFont().isBold());

    image = (JRPrintImage) printFrame.getElements().get(1);
    chart = getChart(image);
    plot = (SpiderWebPlot) chart.getPlot();
    Assert.assertEquals("title", "title", chart.getTitle().getText());
    Assert.assertEquals("subtitle", "subtitle", ((TextTitle) chart.getSubtitle(1)).getText());
}

From source file:com.polivoto.vistas.acciones.Datos.java

private JFreeChart crearChartPie(PieDataset dataset, String titulo) {
    JFreeChart chart = ChartFactory.createPieChart(titulo, dataset, false, true, false);
    PiePlot plot = (PiePlot) chart.getPlot();
    plot.setStartAngle(290);//  w ww.  j  av a2  s .c  om
    plot.setDirection(Rotation.ANTICLOCKWISE);

    plot.setNoDataMessage("No hay votos");
    try {
        if (ac.getConteoOpcionesPregunta().getJSONObject(pox).getInt("participantes") != 0) {
            int j = 0;
            for (int i = 0; i < ac.getConteoOpcionesPregunta().getJSONObject(pox).getJSONArray("conteo")
                    .length(); i++) {
                try {
                    if (ac.getConteoOpcionesPregunta().getJSONObject(pox).getJSONArray("conteo")
                            .getJSONObject(i).getString("reactivo").equals("Anular mi voto")) {
                        plot.setSectionPaint("Nulo", Color.lightGray);
                    } else {
                        plot.setSectionPaint(ac.getConteoOpcionesPregunta().getJSONObject(pox)
                                .getJSONArray("conteo").getJSONObject(i).getString("reactivo"), colores.get(j));
                        j++;
                    }
                } catch (JSONException ex) {
                    ex.printStackTrace();
                }
            }
        }
    } catch (JSONException ex) {
        ex.printStackTrace();
    }
    plot.setSimpleLabels(true);
    plot.setBackgroundPaint(new GradientPaint(0, 0, Color.white, 0, 1000, Color.white));
    PieSectionLabelGenerator gen = new StandardPieSectionLabelGenerator("{0}: {2} de votos",
            new DecimalFormat("0"), new DecimalFormat("0.000%"));
    plot.setLabelGenerator(gen);
    if (rotating) {
        final Rotator rotate = new Rotator(plot);
        rotate.start();
    }
    return chart;
}

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);/*from  w ww .j  a  v a 2  s.co m*/
    PiePlot3D pieplot3d = (PiePlot3D) jfreechart.getPlot();
    pieplot3d.setDrawingSupplier(new ChartDrawingSupplier());
    pieplot3d.setStartAngle(270D);
    pieplot3d.setDirection(Rotation.ANTICLOCKWISE);
    pieplot3d.setForegroundAlpha(0.6F);
    return jfreechart;
}