本文整理汇总了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));
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}