/** * A flag indicating whether the pie chart is circular, or stretched into * an elliptical shape. * * @param flag the new value. * * @see #isCircular() */ public void setCircular(boolean flag) { setCircular(flag, true); }
/** * A flag indicating whether the pie chart is circular, or stretched into * an elliptical shape. * * @param flag the new value. * * @see #isCircular() */ public void setCircular(boolean flag) { setCircular(flag, true); }
public void getPieChart() { DefaultPieDataset pieDataset = new DefaultPieDataset(); pieDataset.setValue("JavaWorld", new Integer(75)); pieDataset.setValue("Other", new Integer(25)); JFreeChart chart = ChartFactory.createPieChart("Discounts Used by Category ", data, true, true, false); //chart.setBackgroundPaint(new Color(222, 222, 255)); final PiePlot plot = (PiePlot) chart.getPlot(); plot.setBackgroundPaint(Color.white); plot.setCircular(true); try { final ChartRenderingInfo info = new ChartRenderingInfo(new StandardEntityCollection()); final File file1 = new File(getServletContext().getRealPath(".") + "/images/charts/piechart.png"); ChartUtilities.saveChartAsPNG(file1, chart, 600, 400, info); } catch (Exception e) { System.out.println(e); } }
plot.setCircular(true);
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;
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; }
piePlot.setCircular(true); piePlot.setLabelGenerator(null); piePlot.setShadowXOffset(0);
plot.setBackgroundPaint(Color.WHITE); plot.setOutlinePaint(Color.WHITE); plot.setCircular(true); plot.setDirection(Rotation.CLOCKWISE); plot.setIgnoreNullValues(true);
plot.setBackgroundPaint(ChartDefaults.transparent); plot.setOutlinePaint(ChartDefaults.transparent); plot.setCircular(true); plot.setDirection(Rotation.CLOCKWISE); plot.setIgnoreNullValues(true);
((PiePlot) plot).setCircular(true); ((PiePlot) plot).setLabelGenerator(null); ((PiePlot) plot).setShadowXOffset(0);
piePlot.setCircular(isCircular);
pieplot.setCircular(circular);