当前位置: 首页>>代码示例>>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;未经允许,请勿转载。