List of usage examples for org.jfree.chart.plot PiePlot3D setStartAngle
public void setStartAngle(double angle)
From source file:chart.PieChart3D.java
public static void main(String[] args) throws Exception { DefaultPieDataset dataset = new DefaultPieDataset(); dataset.setValue("IPhone 5s", new Double(20)); dataset.setValue("SamSung Grand", new Double(20)); dataset.setValue("MotoG", new Double(40)); dataset.setValue("Nokia Lumia", new Double(10)); JFreeChart chart = ChartFactory.createPieChart3D("Mobile Sales", // chart title dataset, // data true, // include legend true, false);/*from w w w. j ava2 s .co m*/ final PiePlot3D plot = (PiePlot3D) chart.getPlot(); plot.setStartAngle(270); plot.setForegroundAlpha(0.60f); plot.setInteriorGap(0.02); int width = 640; /* Width of the image */ int height = 480; /* Height of the image */ File pieChart3D = new File("pie_Chart3D.jpeg"); ChartUtilities.saveChartAsJPEG(pieChart3D, chart, width, height); }
From source file:statistique.PieChart3D.java
public static void main(String[] args) throws Exception { DefaultPieDataset dataset = new DefaultPieDataset(); dataset.setValue("IPhone 5s", new Double(20)); dataset.setValue("SamSung Grand", new Double(20)); dataset.setValue("MotoG", new Double(40)); dataset.setValue("Nokia Lumia", new Double(10)); JFreeChart chart = ChartFactory.createPieChart3D("Mobile Sales", // chart title dataset, // data true, // include legend true, false);/*from w w w . j a v a2 s. c o m*/ final PiePlot3D plot = (PiePlot3D) chart.getPlot(); plot.setStartAngle(270); plot.setForegroundAlpha(0.60f); plot.setInteriorGap(0.02); int width = 640; /* Width of the image */ int height = 480; /* Height of the image */ File pieChart3D = new File("pie_Chart3D.png"); ChartUtilities.saveChartAsPNG(pieChart3D, chart, width, height); }
From source file:edu.coeia.charts.PieChartPanel.java
private static JFreeChart createChart(final PieDataset dataset, String str) { final JFreeChart chart = ChartFactory.createPieChart3D(str, // chart title dataset, // data true, // include legend true, false);/* w ww . j a v a 2 s . com*/ final PiePlot3D plot = (PiePlot3D) chart.getPlot(); plot.setStartAngle(290); plot.setDirection(Rotation.CLOCKWISE); plot.setForegroundAlpha(0.5f); StandardPieSectionLabelGenerator labelGenerator = new StandardPieSectionLabelGenerator("{0} {2}"); plot.setLabelGenerator(labelGenerator); plot.setNoDataMessage("No data to display"); return chart; }
From source file:cz.zcu.kiv.eegdatabase.wui.components.utils.ChartUtils.java
public static BufferedImage gererateChartForTopDownloadHistory(ChoiceHistory choiceHistory, boolean generateEmptyGraph, List<DownloadStatistic> topDownloadedFilesList, long countOfFilesHistory) { long countFile = 0; DefaultPieDataset dataset = new DefaultPieDataset(); if (!generateEmptyGraph && topDownloadedFilesList != null) { for (int i = 0; i < topDownloadedFilesList.size(); i++) { dataset.setValue(topDownloadedFilesList.get(i).getFileName(), new Long(topDownloadedFilesList.get(i).getCount())); countFile = countFile + topDownloadedFilesList.get(i).getCount(); }/*from w ww. j a v a 2 s . c om*/ if (countOfFilesHistory > countFile) { dataset.setValue("Other", countOfFilesHistory - countFile); } } String chartTitle = ResourceUtils.getString("title.dailyStatistic"); if (choiceHistory == ChoiceHistory.WEEKLY) { chartTitle = ResourceUtils.getString("title.weeklyStatistic"); } else if (choiceHistory == ChoiceHistory.MONTHLY) { chartTitle = ResourceUtils.getString("title.monthlyStatistic"); } JFreeChart chart = ChartFactory.createPieChart3D(chartTitle, // chart // title dataset, // data true, // include legend true, false); PiePlot3D plot = (PiePlot3D) chart.getPlot(); plot.setStartAngle(290); plot.setDirection(Rotation.CLOCKWISE); plot.setForegroundAlpha(0.5f); plot.setNoDataMessage(ResourceUtils.getString("label.noDataMessage")); return chart.createBufferedImage(600, 400); }
From source file:de.aidger.view.utils.Charts.java
/** * Creates a 3D pie chart./*from w w w . ja va 2 s.c o m*/ * * @param title * the diagram title * @param dataset * the dataset. * @param width * the width of the chart as image * @param height * the height of the chart as image * * @return the 3D pie chart as image */ public static ImageIcon createPieChart3D(String title, PieDataset dataset, int width, int height) { JFreeChart chart = ChartFactory.createPieChart3D(title, dataset, true, true, false); Font titleFont = UIManager.getFont("TitledBorder.font"); chart.setBackgroundPaint(null); chart.getLegend().setBackgroundPaint(null); chart.getTitle().setFont(new Font(titleFont.getName(), titleFont.getStyle(), 14)); chart.getTitle().setPaint(UIManager.getColor("TitledBorder.titleColor")); chart.setBorderPaint(null); chart.getLegend().setBorder(0, 0, 0, 0); PiePlot3D plot = (PiePlot3D) chart.getPlot(); plot.setStartAngle(290); plot.setForegroundAlpha(0.9f); plot.setDirection(Rotation.CLOCKWISE); plot.setNoDataMessage(_("No data to display.")); plot.setLabelGenerator(null); plot.setInsets(new RectangleInsets(10, 1, 5, 1)); plot.setBackgroundPaint(null); plot.setOutlineVisible(false); plot.setDarkerSides(true); return new ImageIcon(chart.createBufferedImage(width, height)); }
From source file:ntpgraphic.PieChart.java
private static JFreeChart createChart(PieDataset piedataset) { jfreechart = ChartFactory.createPieChart3D("Pie Chart 3D Demo 1", piedataset, true, true, false); PiePlot3D pieplot3d = (PiePlot3D) jfreechart.getPlot(); pieplot3d.setDarkerSides(true);//from w ww . ja v a 2 s . com pieplot3d.setStartAngle(36 * 9); pieplot3d.setNoDataMessage("No data to display"); return jfreechart; }
From source file:graphic.Grafico.java
private static javax.swing.JPanel pizza3D(ArrayList nome, ArrayList valor, String tituloGrafico, float transparencia, String tipo) { DefaultPieDataset data = new DefaultPieDataset(); for (int i = 0; i < nome.toArray().length; i++) { data.setValue("" + nome.get(i).toString(), new Double(valor.get(i).toString())); }/*from w w w . ja v a 2s . c om*/ JFreeChart chart = ChartFactory.createPieChart3D(tituloGrafico, data, true, true, true); java.awt.Color cor = new java.awt.Color(200, 200, 200); chart.setBackgroundPaint(cor); PiePlot3D plot = (PiePlot3D) chart.getPlot(); plot.setLabelLinksVisible(true); plot.setNoDataMessage("No existem dados para serem exibidos no grfico"); plot.setStartAngle(90); plot.setDirection(Rotation.CLOCKWISE); plot.setForegroundAlpha(transparencia); plot.setInteriorGap(0.20); ChartPanel chartPanel = new ChartPanel(chart); return chartPanel; }
From source file:br.com.ifpb.models.Grafico.java
/** * /*from w ww . ja v a2 s . c o m*/ * @param nome * @param valor * @param tituloGrafico * @param transparencia * @param tipo * @return */ private static javax.swing.JPanel pizza3D(ArrayList nome, ArrayList valor, String tituloGrafico, float transparencia, String tipo) { DefaultPieDataset data = new DefaultPieDataset(); for (int i = 0; i < nome.toArray().length; i++) { data.setValue("" + nome.get(i).toString(), new Double(valor.get(i).toString())); } JFreeChart chart = ChartFactory.createPieChart3D(tituloGrafico, data, true, true, true); java.awt.Color cor = new java.awt.Color(200, 200, 200); chart.setBackgroundPaint(cor); PiePlot3D plot = (PiePlot3D) chart.getPlot(); plot.setLabelLinksVisible(true); plot.setNoDataMessage("No existem dados para serem exibidos "); plot.setStartAngle(90); plot.setDirection(Rotation.CLOCKWISE); plot.setForegroundAlpha(transparencia); plot.setInteriorGap(0.20); ChartPanel chartPanel = new ChartPanel(chart); return chartPanel; }
From source file:userInterface.StateAdminRole.DecisionChartJPanel.java
private static JFreeChart createChart(PieDataset piedataset) { JFreeChart jfreechart = ChartFactory.createPieChart3D("Top 5 Vaccines", piedataset, true, false, false); PiePlot3D pieplot3d = (PiePlot3D) jfreechart.getPlot(); pieplot3d.setStartAngle(270D); pieplot3d.setDirection(Rotation.ANTICLOCKWISE); pieplot3d.setForegroundAlpha(0.6F);//from ww w . j a v a 2 s. c o m return jfreechart; }
From source file:org.jfree.chart.demo.ThumbnailDemo1.java
private static JFreeChart createChart2(PieDataset piedataset) { JFreeChart jfreechart = ChartFactory.createPieChart3D("Pie Chart 3D Demo 1", piedataset, true, true, false); jfreechart.setBackgroundPaint(Color.white); PiePlot3D pieplot3d = (PiePlot3D) jfreechart.getPlot(); pieplot3d.setDarkerSides(true);/*from w ww.jav a 2s.c o m*/ pieplot3d.setStartAngle(290D); pieplot3d.setDirection(Rotation.CLOCKWISE); pieplot3d.setForegroundAlpha(0.5F); pieplot3d.setOutlinePaint(null); pieplot3d.setNoDataMessage("No data to display"); return jfreechart; }