List of usage examples for org.jfree.chart.plot PiePlot3D setDirection
public void setDirection(Rotation direction)
From source file:userInterface.cdcRole.DecisionChartJPanel.java
private static JFreeChart createChart2(PieDataset piedataset) { JFreeChart jfreechart = ChartFactory.createPieChart3D("Top 5 Vaccines", piedataset, true, false, false); PiePlot3D pieplot3d = (PiePlot3D) jfreechart.getPlot(); pieplot3d.setStartAngle(270D);//from w ww . ja v a 2s . c o m pieplot3d.setDirection(Rotation.ANTICLOCKWISE); pieplot3d.setForegroundAlpha(0.6F); return jfreechart; }
From source file:userInterface.cdcRole.DecisionChartJPanel.java
private static JFreeChart createChart1(PieDataset piedataset) { JFreeChart jfreechart = ChartFactory.createPieChart3D("Top 5 Hospitals (For Orders Placed)", piedataset, true, false, false);//w w w .ja v a2 s . c o m PiePlot3D pieplot3d = (PiePlot3D) jfreechart.getPlot(); pieplot3d.setStartAngle(270D); pieplot3d.setDirection(Rotation.ANTICLOCKWISE); pieplot3d.setForegroundAlpha(0.6F); return jfreechart; }
From source file:edu.wpi.cs.wpisuitetng.modules.requirementmanager.view.requirements.NewPieChartPanel.java
/** * @param dataset/*w ww . j a va2 s . c om*/ * the data to be displayed by the pie chart * @param title * the title of the chart @return the pie chart to be displayed */ private static JFreeChart createChart(PieDataset dataset, String title) { JFreeChart chart = ChartFactory.createPieChart3D(title, // chart title dataset, // data true, // include legend true, false); PiePlot3D plot = (PiePlot3D) chart.getPlot();// 3D pie chart. the cats // are going to love // this. plot.setLabelFont(new Font("SansSerif", Font.PLAIN, 12)); plot.setNoDataMessage("No data available"); plot.setCircular(true); plot.setLabelGap(0.02); plot.setStartAngle(270); plot.setDirection(Rotation.ANTICLOCKWISE); //Rotator rotator = new Rotator(plot); //rotator.start(); return chart; }
From source file:userInterface.cdcRole.DecisionChartJPanel.java
private static JFreeChart createChart(PieDataset piedataset) { // System.out.println("1"); JFreeChart jfreechart = ChartFactory.createPieChart3D("Top 5 States (For Vaccinations)", piedataset, true, false, false);/* w ww .j ava 2 s . c om*/ PiePlot3D pieplot3d = (PiePlot3D) jfreechart.getPlot(); pieplot3d.setDrawingSupplier(new ChartDrawingSupplier()); pieplot3d.setStartAngle(270D); pieplot3d.setDirection(Rotation.ANTICLOCKWISE); pieplot3d.setForegroundAlpha(0.6F); return jfreechart; }
From source file:de.xirp.chart.ChartManager.java
/** * Returns a pie chart. The chart is generated from the given * {@link de.xirp.db.Record} and key array. The flag * <code>relative</code> indicated whether or not relative * values should be used./*from w ww . ja va2 s . c om*/ * * @param record * The record containing the data. * @param keys * The keys to use. * @param relative * Flag indicating if relative values should be used. * @return A pie chart. * @see org.jfree.chart.JFreeChart * @see de.xirp.db.Record */ private static JFreeChart createPieChart(Record record, String[] keys, boolean relative) { String chartTitle = (relative ? I18n.getString("ChartManager.text.relative") //$NON-NLS-1$ : I18n.getString("ChartManager.text.absolute")) //$NON-NLS-1$ + I18n.getString("ChartManager.text.occurencesOfKey") + record.getName() + ": "; //$NON-NLS-1$ //$NON-NLS-2$ DefaultPieDataset dataset = new DefaultPieDataset(); Map<String, Long> values; values = ChartDatabaseUtil.getValuesForRecord(record, keys, relative); for (String s : values.keySet()) { dataset.setValue(s, values.get(s)); } JFreeChart chart; if (options.is(OptionName.THREE_D)) { chart = ChartFactory.createPieChart3D(chartTitle, dataset, true, true, false); PiePlot3D plot = (PiePlot3D) chart.getPlot(); plot.setStartAngle(290); plot.setDirection(Rotation.CLOCKWISE); plot.setForegroundAlpha(0.5f); plot.setNoDataMessage(NO_DATA_AVAILABLE); plot.setLabelGenerator(new CustomLabelGenerator(options)); } else { chart = ChartFactory.createPieChart(chartTitle, dataset, true, true, false); PiePlot plot = (PiePlot) chart.getPlot(); plot.setSectionOutlinesVisible(true); plot.setNoDataMessage(NO_DATA_AVAILABLE); plot.setCircular(false); plot.setLabelGap(0.02); plot.setLabelGenerator(new CustomLabelGenerator(options)); } exportAutomatically(null, chart); return chart; }
From source file:org.codehaus.mojo.dashboard.report.plugin.chart.PieChart3DRenderer.java
public void createChart() { PieDataset dataset = (PieDataset) this.datasetStrategy.getDataset(); report = ChartFactory.createPieChart3D(this.datasetStrategy.getTitle(), dataset, false, true, true); PiePlot3D plot3D = (PiePlot3D) report.getPlot(); plot3D.setDirection(Rotation.ANTICLOCKWISE); plot3D.setStartAngle(PieChart3DRenderer.START_ANGLE); plot3D.setForegroundAlpha(PieChart3DRenderer.FOREGROUND_ALPHA); plot3D.setLabelFont(new Font("Lucida", 0, PieChart3DRenderer.FONT_SIZE)); }
From source file:javaapplication2.PieChart.java
private JFreeChart createChart(PieDataset dataset, String title) { JFreeChart chart = ChartFactory.createPieChart3D(title, dataset, true, true, false); PiePlot3D plot = (PiePlot3D) chart.getPlot(); plot.setStartAngle(290);// w ww . j ava2 s. c o m plot.setDirection(Rotation.CLOCKWISE); plot.setForegroundAlpha(0.5f); return chart; }
From source file:com.codeandme.jfreechart.DemoView.java
private org.jfree.chart.JFreeChart createChart(final PieDataset dataset, final String title) { final JFreeChart chart = ChartFactory.createPieChart3D(title, dataset, true, true, false); final PiePlot3D plot = (PiePlot3D) chart.getPlot(); plot.setStartAngle(290);//from w ww. j av a 2s . c o m plot.setDirection(Rotation.CLOCKWISE); plot.setForegroundAlpha(0.5f); return chart; }
From source file:de.berlios.statcvs.xml.chart.AbstractPieChart.java
/** * @param filename//from w w w.j a v a 2 s . c o m * @param title */ public AbstractPieChart(ReportSettings settings, String filename, String title) { super(settings, filename, title); dataset = new DefaultPieDataset(); JFreeChart chart = ChartFactory.createPieChart3D(settings.getProjectName(), // chart title dataset, // data true, // include legend true, false); PiePlot3D plot = (PiePlot3D) chart.getPlot(); plot.setStartAngle(270); plot.setDirection(Rotation.CLOCKWISE); plot.setForegroundAlpha(0.5f); //plot.setDepthFactor(0.2); plot.setDepthFactor(0.01); setChart(chart); }
From source file:JFreeChartScriptlet.java
@Override public void afterReportInit() throws JRScriptletException { DefaultPieDataset dataset = new DefaultPieDataset(); dataset.setValue("Java", 43.2d); dataset.setValue("Visual Basic", 10.0d); dataset.setValue("C/C++", 17.5d); dataset.setValue("PHP", 32.5d); dataset.setValue("Perl", 1.0d); JFreeChart chart = ChartFactory.createPieChart3D("Pie Chart 3D Demo 1", dataset, true, true, false); PiePlot3D plot = (PiePlot3D) chart.getPlot(); plot.setStartAngle(290);//from w ww . java2s .c o m plot.setDirection(Rotation.CLOCKWISE); plot.setForegroundAlpha(0.5f); plot.setNoDataMessage("No data to display"); /* */ this.setVariableValue("Chart", new JCommonDrawableRendererImpl(chart)); }