當前位置: 首頁>>代碼示例>>Java>>正文


Java PiePlot.setNoDataMessage方法代碼示例

本文整理匯總了Java中org.jfree.chart.plot.PiePlot.setNoDataMessage方法的典型用法代碼示例。如果您正苦於以下問題:Java PiePlot.setNoDataMessage方法的具體用法?Java PiePlot.setNoDataMessage怎麽用?Java PiePlot.setNoDataMessage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.jfree.chart.plot.PiePlot的用法示例。


在下文中一共展示了PiePlot.setNoDataMessage方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: PieChart

import org.jfree.chart.plot.PiePlot; //導入方法依賴的package包/類
public PieChart() {
    DefaultPieDataset data = getDataSet();
    JFreeChart chart = ChartFactory.createPieChart3D("水果產量", data, true, false, false);
    //設置百分比
    PiePlot pieplot = (PiePlot) chart.getPlot();
    DecimalFormat df = new DecimalFormat("0.00%");//獲得一個DecimalFormat對象,主要是設置小數問題
    NumberFormat nf = NumberFormat.getNumberInstance();//獲得一個NumberFormat對象
    StandardPieSectionLabelGenerator sp1 = new StandardPieSectionLabelGenerator("{0}  {2}", nf, df);//獲得StandardPieSectionLabelGenerator對象
    pieplot.setLabelGenerator(sp1);//設置餅圖顯示百分比

    //沒有數據的時候顯示的內容
    pieplot.setNoDataMessage("無數據顯示");
    pieplot.setCircular(false);
    pieplot.setLabelGap(0.02D);

    pieplot.setIgnoreNullValues(true);//設置不顯示空值
    pieplot.setIgnoreZeroValues(true);//設置不顯示負值
    frame1 = new ChartPanel(chart, true);
    chart.getTitle().setFont(new Font("宋體", Font.BOLD, 20));//設置標題字體
    PiePlot piePlot = (PiePlot) chart.getPlot();//獲取圖表區域對象
    piePlot.setLabelFont(new Font("宋體", Font.BOLD, 10));//解決亂碼
    chart.getLegend().setItemFont(new Font("黑體", Font.BOLD, 10));
}
 
開發者ID:leon66666,項目名稱:financehelper,代碼行數:24,代碼來源:PieChart.java

示例2: createChart

import org.jfree.chart.plot.PiePlot; //導入方法依賴的package包/類
/**
 * Creates a chart.
 * 
 * @param dataset  the dataset.
 * 
 * @return A chart.
 */
private static JFreeChart createChart(PieDataset dataset) {
    
    JFreeChart chart = ChartFactory.createPieChart(
        "Pie Chart Demo 1",  // chart title
        dataset,             // data
        true,               // include legend
        true,
        false
    );

    PiePlot plot = (PiePlot) chart.getPlot();
    plot.setSectionOutlinesVisible(false);
    plot.setLabelFont(new Font("SansSerif", Font.PLAIN, 12));
    plot.setNoDataMessage("No data available");
    plot.setCircular(false);
    plot.setLabelGap(0.02);
    return chart;
    
}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:27,代碼來源:SWTPieChartDemo1.java

示例3: createEmptyChart

import org.jfree.chart.plot.PiePlot; //導入方法依賴的package包/類
protected JFreeChart createEmptyChart(PieDataset dataset) {

 		JFreeChart chart = ChartFactory.createPieChart(
             "SOCR Chart",  // chart title
             null,             // data
             true,                // include legend
             true,
             false
         );

         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;
 }
 
開發者ID:SOCR,項目名稱:HTML5_WebSite,代碼行數:18,代碼來源:StockApplication.java

示例4: createEmptyChart

import org.jfree.chart.plot.PiePlot; //導入方法依賴的package包/類
protected JFreeChart createEmptyChart(String chartTitle, PieDataset dataset) {

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

        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;
}
 
開發者ID:SOCR,項目名稱:HTML5_WebSite,代碼行數:18,代碼來源:PortfolioApplication2.java

示例5: createChart

import org.jfree.chart.plot.PiePlot; //導入方法依賴的package包/類
/**
 * Creates a chart.
 *
 * @param dataset  the dataset.
 *
 * @return A chart.
 */
private static JFreeChart createChart(PieDataset dataset) {

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

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

    return chart;

}
 
開發者ID:lulab,項目名稱:PI,代碼行數:25,代碼來源:PieChartDemo1.java

示例6: createEmptyChart

import org.jfree.chart.plot.PiePlot; //導入方法依賴的package包/類
protected JFreeChart createEmptyChart(PieDataset dataset) {
       
		JFreeChart chart = ChartFactory.createPieChart(
            "SOCR Chart",  // chart title
            null,             // data
            true,                // include legend
            true,
            false
        );
        
        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;
}
 
開發者ID:SOCR,項目名稱:HTML5_WebSite,代碼行數:18,代碼來源:BinomialTradingApplication.java

示例7: createEmptyChart

import org.jfree.chart.plot.PiePlot; //導入方法依賴的package包/類
protected JFreeChart createEmptyChart(PieDataset dataset) {
        
		JFreeChart chart = ChartFactory.createPieChart(
            "SOCR Chart",  // chart title
            null,             // data
            true,                // include legend
            true,
            false
        );
        
        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;
}
 
開發者ID:SOCR,項目名稱:HTML5_WebSite,代碼行數:18,代碼來源:Chart.java

示例8: createChart

import org.jfree.chart.plot.PiePlot; //導入方法依賴的package包/類
/**
 * Creates a chart.
 *
 * @param dataset  the dataset.
 *
 * @return A chart.
 */
private static JFreeChart createChart(PieDataset dataset) {

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

    PiePlot plot = (PiePlot) chart.getPlot();
    plot.setSectionOutlinesVisible(false);
    plot.setLabelFont(new Font("SansSerif", Font.PLAIN, 12));
    plot.setNoDataMessage("No data available");
    plot.setCircular(false);
    plot.setLabelGap(0.02);
    return chart;
}
 
開發者ID:SpoonLabs,項目名稱:astor,代碼行數:26,代碼來源:SWTPieChartDemo1.java

示例9: createChart

import org.jfree.chart.plot.PiePlot; //導入方法依賴的package包/類
@Override
public JFreeChart createChart(PieDataset pieDataSet, boolean createLegend) {
	JFreeChart chart = ChartFactory.createRingChart(
			null,
			pieDataSet,
			createLegend, // legend
			true,
			false);
	
	PiePlot plot = (PiePlot) chart.getPlot();
	plot.setSectionOutlinesVisible(false);
	plot.setLabelFont(new Font("SansSerif", Font.PLAIN, 11));
	plot.setNoDataMessage("No data available");
	plot.setCircular(false);
	plot.setLabelGap(0.02);

	return chart;
}
 
開發者ID:rapidminer,項目名稱:rapidminer-5,代碼行數:19,代碼來源:RingChartPlotter.java

示例10: createChart

import org.jfree.chart.plot.PiePlot; //導入方法依賴的package包/類
@Override
public JFreeChart createChart(PieDataset pieDataSet, boolean createLegend) {
	JFreeChart chart = ChartFactory.createRingChart(null, pieDataSet, createLegend, // legend
			true, false);

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

	return chart;
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:15,代碼來源:RingChartPlotter.java

示例11: createChart

import org.jfree.chart.plot.PiePlot; //導入方法依賴的package包/類
@Override
public JFreeChart createChart(PieDataset pieDataSet, boolean createLegend) {
	JFreeChart chart = ChartFactory.createRingChart(null, pieDataSet, createLegend, // legend
			true, false);

	PiePlot plot = (PiePlot) chart.getPlot();
	plot.setSectionOutlinesVisible(false);
	plot.setLabelFont(FontTools.getFont(Font.SANS_SERIF, Font.PLAIN, 11));
	plot.setNoDataMessage("No data available");
	plot.setCircular(true);
	plot.setLabelGap(0.02);

	return chart;
}
 
開發者ID:rapidminer,項目名稱:rapidminer-studio,代碼行數:15,代碼來源:RingChartPlotter.java

示例12: createChart

import org.jfree.chart.plot.PiePlot; //導入方法依賴的package包/類
/**
   * Creates a demo chart.
   * 
   * @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;
  }
 
開發者ID:SOCR,項目名稱:HTML5_WebSite,代碼行數:43,代碼來源:PieChartDemo3.java

示例13: createChart

import org.jfree.chart.plot.PiePlot; //導入方法依賴的package包/類
protected JFreeChart createChart(PieDataset dataset) {
      // create the chart...
      JFreeChart chart = ChartFactory.createPieChart(
          chartTitle,  // chart title
          dataset,             // dataset
          !legendPanelOn,               // include legend
          true,
          false
      );

      // set the background color for the chart...
      chart.setBackgroundPaint(new Color(222, 222, 255));
      PiePlot plot = (PiePlot) chart.getPlot();
      plot.setBackgroundPaint(Color.white);
      plot.setCircular(true);
      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);
      	}
      }
      plot.setLabelGenerator(new StandardPieSectionLabelGenerator("{0} = {2}",
              NumberFormat.getNumberInstance(), 
              NumberFormat.getPercentInstance()));
      plot.setNoDataMessage("No data available");

      if(rotateOn){
      	Rotator rotator = new Rotator(plot);
      	rotator.start();
      }
setCategorySummary(dataset);
return chart;
  }
 
開發者ID:SOCR,項目名稱:HTML5_WebSite,代碼行數:35,代碼來源:PieChartDemo4.java

示例14: createChart

import org.jfree.chart.plot.PiePlot; //導入方法依賴的package包/類
/**
   * Creates a sample chart.
   * 
   * @param dataset  the dataset.
   * 
   * @return A chart.
   */
  protected JFreeChart createChart(PieDataset dataset) {
       JFreeChart chart = ChartFactory.createPieChart(
          chartTitle,  // chart title
          dataset,             // dataset
          !legendPanelOn,                // include legend
          true,
          false
      );
   
   PiePlot plot = (PiePlot) chart.getPlot();
      plot.setNoDataMessage("No data available");
      
      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);
      	}
      }
      
      plot.setLegendLabelToolTipGenerator(
          new StandardPieSectionLabelGenerator("Tooltip for legend item {0}")
      );

      if(rotateOn){
      	Rotator rotator = new Rotator(plot);
      	rotator.start();
      }
      
setCategorySummary(dataset);
      return chart;
  }
 
開發者ID:SOCR,項目名稱:HTML5_WebSite,代碼行數:40,代碼來源:PieChartDemo2.java

示例15: createChart

import org.jfree.chart.plot.PiePlot; //導入方法依賴的package包/類
/**
     * Creates a chart.
     * 
     * @param dataset  the dataset.
     * 
     * @return a chart.
     */
    protected JFreeChart createChart(PieDataset dataset) {
        
		JFreeChart chart = ChartFactory.createPieChart(
            chartTitle,  // chart title
            dataset,             // data
            !legendPanelOn,                // include legend
            true,
            false
        );
        TextTitle title = chart.getTitle();
        title.setToolTipText("A title tooltip!");
       
        
        PiePlot plot = (PiePlot) chart.getPlot();
        if (!ThreeDPie){
        	for (int i=0; i<pulloutFlag.length; i++){
        	//System.out.println("SuperPieChart\""+pulloutFlag[i]+"\"");
        		if (pulloutFlag[i].equals("1")){
            		Comparable key = dataset.getKey(i);
            		plot.setExplodePercent(key, 0.30);
            	}
        	}
        }
        plot.setLabelFont(new Font("SansSerif", Font.PLAIN, 12));
        plot.setNoDataMessage("No data available");
        plot.setCircular(false);
        plot.setLabelGap(0.02);
		
        return chart;
}
 
開發者ID:SOCR,項目名稱:HTML5_WebSite,代碼行數:38,代碼來源:SuperPieChart.java


注:本文中的org.jfree.chart.plot.PiePlot.setNoDataMessage方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。