Example usage for org.jfree.chart.plot PiePlot setNoDataMessage

List of usage examples for org.jfree.chart.plot PiePlot setNoDataMessage

Introduction

In this page you can find the example usage for org.jfree.chart.plot PiePlot setNoDataMessage.

Prototype

public void setNoDataMessage(String message) 

Source Link

Document

Sets the message that is displayed when the dataset is empty or null, and sends a PlotChangeEvent to all registered listeners.

Usage

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

/**
 * Default constructor.//from   www .  j  a  va 2 s  .  c  o  m
 *
 * @param title  the frame title.
 */
public PieChartDemo3(final String title) {

    super(title);

    // create a dataset...
    final DefaultPieDataset data = new DefaultPieDataset();

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

    final PiePlot plot = (PiePlot) chart.getPlot();
    plot.setNoDataMessage("No data available");
    plot.setNoDataMessageFont(new Font("Serif", Font.ITALIC, 10));
    plot.setNoDataMessagePaint(Color.red);

    // add the chart to a panel...
    final ChartPanel chartPanel = new ChartPanel(chart);
    chartPanel.setPreferredSize(new java.awt.Dimension(500, 270));
    setContentPane(chartPanel);

}

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

/**
 * Creates a sample chart.//from   w  w  w .ja v  a 2s. co  m
 * 
 * @param dataset  the dataset.
 * 
 * @return a chart.
 */
private JFreeChart createChart(final PieDataset dataset) {
    final JFreeChart chart = ChartFactory.createPieChart("Pie Chart Demo 2", // chart title
            dataset, // dataset
            true, // include legend
            true, false);
    final PiePlot plot = (PiePlot) chart.getPlot();
    plot.setNoDataMessage("No data available");
    plot.setExplodePercent(1, 0.30);
    return chart;
}

From source file:com.waitwha.nessus.trendanalyzer.gui.PieChartPanel.java

public PieChartPanel(String title, PieDataset dataset) {
    super(new BorderLayout());

    JFreeChart chart = ChartFactory.createPieChart(title, dataset, true, true, false);

    PiePlot plot = (PiePlot) chart.getPlot();
    plot.setSectionOutlinesVisible(true);
    plot.setNoDataMessage("No data available");

    ChartPanel panel = new ChartPanel(chart);
    panel.setMouseWheelEnabled(true);//from   w w  w.  j ava2 s. c  o  m
    this.add(panel, BorderLayout.CENTER);
    this.validate();
}

From source file:View.RIM.Components.PieChart.java

private JFreeChart createChart(PieDataset dataset) {

    JFreeChart chart = ChartFactory.createPieChart(null, // chart title
            dataset, // data
            true, // include legend
            true, false);/*from ww  w.  j a  va2 s . c  o m*/
    PiePlot plot = (PiePlot) chart.getPlot();
    plot.setSectionOutlinesVisible(false);
    plot.setNoDataMessage("No data available");
    return chart;

}

From source file:com.googlecode.logVisualizer.chart.PieChartBuilder.java

private JFreeChart createChart(final PieDataset dataset) {

    final JFreeChart chart = ChartFactory.createPieChart(getTitle(), dataset, isIncludeLegend(), true, false);
    final PiePlot plot = (PiePlot) chart.getPlot();

    plot.setSectionOutlinesVisible(false);
    plot.setNoDataMessage("No data available");
    plot.setIgnoreNullValues(true);//from w w w  .  j av a  2  s .  c  o m
    plot.setIgnoreZeroValues(true);

    return chart;
}

From source file:pingsnmpapp.classPieGraph.java

public JFreeChart createChart(PieDataset dataset) {

    JFreeChart chart = ChartFactory.createPieChart("Grfica de Disco", // chart title
            dataset, // data
            true, // include legend
            true, false);//from  www  . j  a va2s  .  c o m

    PiePlot plot = (PiePlot) chart.getPlot();
    plot.setLabelFont(new Font("SansSerif", Font.PLAIN, 12));
    plot.setNoDataMessage("No data available");
    plot.setCircular(false);
    plot.setLabelGap(0.02);
    return chart;

}

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

/**
 * Creates a demo chart.// w w w .  j a  va  2  s .  co m
 * 
 * @param dataset  the dataset.
 * 
 * @return A chart.
 */
protected JFreeChart createChart(PieDataset dataset) {
    dataset = null;

    JFreeChart chart = ChartFactory.createPieChart(chartTitle, // chart title
            dataset, // data
            !legendPanelOn, // include legend
            true, false);

    PiePlot plot = (PiePlot) chart.getPlot();
    plot.setNoDataMessage("No data available so we go into this really "
            + "long spiel about what that means and it runs off the end of the "
            + "line but what can you do about that!");
    plot.setNoDataMessageFont(new Font("Serif", Font.ITALIC, 10));
    plot.setNoDataMessagePaint(Color.red);
    for (int i = 0; i < pulloutFlag.length; i++) {
        //System.out.println("\""+pulloutFlag[i]+"\"");
        if (isPullout(i)) {
            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:charts.ErrorPorcentajePie.java

private JFreeChart createChart(PieDataset dataset, String title) {
    JFreeChart chart = ChartFactory.createPieChart(title, dataset, true, true, false);
    PiePlot plot = (PiePlot) chart.getPlot();
    plot.setLabelFont(new Font("SansSerif", Font.PLAIN, 12));
    plot.setNoDataMessage("no data");
    plot.setCircular(false);//from w w w.  j  av a 2 s .c  om
    plot.setLabelGap(0.02);
    return chart;
}

From source file:charts.AceptadosRechazadosPie.java

private JFreeChart createChart(PieDataset dataset, String title) {
    JFreeChart chart = ChartFactory.createPieChart(title, dataset, true, true, false);
    //                createBarChart(title, "Cantidades", "Estado de las trazas", dataset, PlotOrientation.VERTICAL, true, true, false);
    PiePlot plot = (PiePlot) chart.getPlot();
    plot.setLabelFont(new Font("SansSerif", Font.PLAIN, 11));

    plot.setNoDataMessage("no data");
    plot.setCircular(false);/*from  w  ww.  j  a v a2  s  .  co m*/
    plot.setLabelGap(0.02);
    return chart;
}

From source file:com.thingsfx.swing.jfreechart.JFreeChartPanel.java

void initComponents() {

    PieDataset dataset = createDataset();
    JFreeChart chart = ChartFactory.createPieChart("JFree in JavaFX Chart Is Cool!", // chart title
            dataset, // data
            true, // include legend
            true, false);/*from www . j  a v  a2 s.c  o m*/

    PiePlot plot = (PiePlot) chart.getPlot();
    plot.setSectionOutlinesVisible(false);
    plot.setNoDataMessage("No data available");

    add(new ChartPanel(chart));
}