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

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

Introduction

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

Prototype

public void setForegroundAlpha(float alpha) 

Source Link

Document

Sets the alpha-transparency for the plot and sends a PlotChangeEvent to all registered listeners.

Usage

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

/**
 * Creates a sample chart./*  www .jav  a2  s. c o  m*/
 * 
 * @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

/**
 *
 *//*from  www  .  j a  v a 2 s.c o  m*/
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));
}

From source file:unikn.dbis.univis.visualization.chart.PieChart.java

/**
 * Makes the plot./*from w w w  .j  a v a  2 s.  c  o  m*/
 */
protected void plot() {
    PiePlot3D plot = (PiePlot3D) getChart().getPlot();
    plot.setStartAngle(290);
    plot.setDirection(Rotation.CLOCKWISE);
    plot.setForegroundAlpha(0.5f);
    plot.setNoDataMessage("No data available");
    plot.setLabelGenerator(null);
    plot.setLegendLabelGenerator(new LabelGenerator(createTotal()));
}

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:aplicacion.gestion.tablero.logic.PieChart3DDemo1.java

/**
 * Creates a sample chart.//from   ww  w  . j a  va 2  s  .  co  m
 * 
 * @param dataset  the dataset.
 * 
 * @return A chart.
 */
private JFreeChart createChart(final PieDataset dataset) {

    final JFreeChart chart = ChartFactory.createPieChart3D("Pie Chart 3D Demo 1", // 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");
    return chart;

}

From source file:bzstats.chart.KillRatioChart.java

/**
 * @see bzstats.chart.ChartFactory#getChart()
 *//*  w  w  w .j av  a2s. c  o m*/
protected JFreeChart getChart() {

    DefaultPieDataset dataset = new DefaultPieDataset();

    Iterator playeriter = stats.getPlayerStats().values().iterator();

    PlayerStats player;
    int playercount = 0;
    while (playeriter.hasNext() && (playercount++ < MAXPLAYERS)) {
        player = (PlayerStats) playeriter.next();
        dataset.setValue(player.getName(), player.getKillRatio());
    }

    //       create chart and plot
    JFreeChart chart = ChartFactory.createPieChart3D("Killratio", // chart title
            dataset, // data
            false, // include legend
            true, false);

    chart.addSubtitle(new TextTitle("kills/deaths"));

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

    return chart;
}

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  ww w . j  av a2s.c o m*/
    plot.setDirection(Rotation.ANTICLOCKWISE);
    plot.setForegroundAlpha(0.5f);
    rotator = new Rotator(plot, 0);
    rotator.start();
    return chart;
}

From source file:org.pentaho.reporting.engine.classic.demo.ancient.demo.chartdemo.BasicExtXmlChartDemo.java

/**
 * Creates a sample chart.// www  .  java2  s .c  o m
 *
 * @param dataset the dataset.
 * @return A chart.
 */
private JFreeChart createChart(final PieDataset dataset) {

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

    // set the background color for the chart...
    chart.setBackgroundPaint(Color.yellow);
    final PiePlot3D plot = (PiePlot3D) chart.getPlot();
    plot.setStartAngle(270);
    //    plot.setDirection(Rotation.CLOCKWISE);
    plot.setForegroundAlpha(0.5f);
    plot.setNoDataMessage("No data to display");

    return chart;

}

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

/**
 * Creates a sample chart.//from   w w  w.  j  a  va 2s  .co m
 * 
 * @param dataset  the dataset.
 * 
 * @return A chart.
 */
private JFreeChart createChart(final PieDataset dataset) {

    final JFreeChart chart = ChartFactory.createPieChart3D("Pie Chart 3D Demo 4", // 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(new CustomLabelGenerator());
    return chart;

}

From source file:Grafica.java

private void init() {
    panel = new JPanel();
    getContentPane().add(panel);// w w  w.j av a 2  s .  c o m
    // Fuente de Datos
    DefaultPieDataset defaultpiedataset = new DefaultPieDataset();
    defaultpiedataset.setValue("Abiertas 81%", new Double(81D));
    defaultpiedataset.setValue("Cerradas 19%", new Double(19D));
    //        defaultpiedataset.setValue("Hacking", new Double(19.5D));
    //        defaultpiedataset.setValue("SEO", new Double(30.5D));
    //        defaultpiedataset.setValue("Redes", new Double(2.0D));

    // Creando el Grafico
    JFreeChart chart = ChartFactory.createPieChart3D("Informe De Asignacin De Clases", defaultpiedataset,
            true, true, false);
    PiePlot3D pieplot3d = (PiePlot3D) chart.getPlot();
    pieplot3d.setDepthFactor(0.5);
    pieplot3d.setStartAngle(290D);
    pieplot3d.setDirection(Rotation.CLOCKWISE);
    pieplot3d.setForegroundAlpha(0.5F);

    // Mostrar Grafico
    ChartPanel chartPanel = new ChartPanel(chart);
    panel.add(chartPanel);
}