pieplot.setNoDataMessage("No data available"); pieplot.setExplodePercent(topApi, 0.20000000000000001D);
)); plot.setNoDataMessage("No data available");
/** * 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; }
JFreeChart chart = ChartFactory.createPieChart3D("World Polulation by Countries ", dataset, true, true, true); PiePlot plot = (PiePlot) chart.getPlot(); plot.setPieIndex(0); // plot.setLabelFont(new Font("SansSerif", Font.NORMAL, 12)); plot.setNoDataMessage("No data available"); plot.setCircular(false); plot.setLabelLinksVisible(true); // plot.zoom(200); // plot.setStartAngle(180); // plot.setLabelBackgroundPaint(paint); plot.setLabelLinkMargin(0.01); return chart;
} else { plot.setLabelFont(new Font("SansSerif", Font.PLAIN, 12)); plot.setNoDataMessage("No data available");
public JFreeChart createPieChart(String title, PieDataset dataset) { JFreeChart chart = ChartFactory.createPieChart(title, dataset, true, true, false); PiePlot plot = (PiePlot) chart.getPlot(); plot.setCircular(true); plot.setDirection(Rotation.CLOCKWISE); plot.setNoDataMessage("No data to display"); StandardPieSectionLabelGenerator labelGenerator = new StandardPieSectionLabelGenerator("{0} {1} ({2})"); plot.setLabelGenerator(labelGenerator); plot.setInteriorGap(0.01); plot.setMaximumLabelWidth(0.32); Font font = new Font(chart.getLegend().getItemFont().getFamily(), Font.PLAIN, 12); plot.setLabelFont(font); plot.setLabelBackgroundPaint(new Color(220, 220, 220)); font = new Font(chart.getLegend().getItemFont().getFamily(), Font.PLAIN, 12); chart.getLegend().setItemFont(font); return chart; }
"{0} = {1} ({2})", NumberFormat.getNumberInstance(), NumberFormat.getPercentInstance() )); plot.setNoDataMessage(Messages.Dashboard_NoDataAvailable());
plot.setNoDataMessage(ElementsThreadLocals.getText("no.data.available"));