List of usage examples for org.jfree.chart.plot PiePlot3D setStartAngle
public void setStartAngle(double angle)
From source file:unikn.dbis.univis.visualization.chart.PieChart.java
/** * Makes the plot./* w w w .ja v a2 s . c o m*/ */ protected void plot() { PiePlot3D plot = (PiePlot3D) getChart().getPlot(); plot.setStartAngle(290); plot.setDirection(Rotation.CLOCKWISE); plot.setForegroundAlpha(0.5f); plot.setNoDataMessage("No data available"); plot.setLabelGenerator(null); plot.setLegendLabelGenerator(new LabelGenerator(createTotal())); }
From source file:aplicacion.gestion.tablero.logic.PieChart3DDemo1.java
/** * Creates a sample chart.//from w w w . jav a2 s . c om * * @param dataset the dataset. * * @return A chart. */ private JFreeChart createChart(final PieDataset dataset) { final JFreeChart chart = ChartFactory.createPieChart3D("Pie Chart 3D Demo 1", // chart title dataset, // data true, // include legend true, false); final PiePlot3D plot = (PiePlot3D) chart.getPlot(); plot.setStartAngle(290); plot.setDirection(Rotation.CLOCKWISE); plot.setForegroundAlpha(0.5f); plot.setNoDataMessage("No data to display"); return chart; }
From source file:bzstats.chart.KillRatioChart.java
/** * @see bzstats.chart.ChartFactory#getChart() *//*from w ww . java2s. co m*/ protected JFreeChart getChart() { DefaultPieDataset dataset = new DefaultPieDataset(); Iterator playeriter = stats.getPlayerStats().values().iterator(); PlayerStats player; int playercount = 0; while (playeriter.hasNext() && (playercount++ < MAXPLAYERS)) { player = (PlayerStats) playeriter.next(); dataset.setValue(player.getName(), player.getKillRatio()); } // create chart and plot JFreeChart chart = ChartFactory.createPieChart3D("Killratio", // chart title dataset, // data false, // include legend true, false); chart.addSubtitle(new TextTitle("kills/deaths")); final PiePlot3D plot = (PiePlot3D) chart.getPlot(); plot.setStartAngle(290); plot.setDirection(Rotation.CLOCKWISE); plot.setForegroundAlpha(0.5f); plot.setBackgroundAlpha(0); plot.setNoDataMessage("No data to display"); plot.setDepthFactor(.1f); return chart; }
From source file:Grafica.java
private void init() { panel = new JPanel(); getContentPane().add(panel);/* ww w . j a va2 s . c o m*/ // Fuente de Datos DefaultPieDataset defaultpiedataset = new DefaultPieDataset(); defaultpiedataset.setValue("Abiertas 81%", new Double(81D)); defaultpiedataset.setValue("Cerradas 19%", new Double(19D)); // defaultpiedataset.setValue("Hacking", new Double(19.5D)); // defaultpiedataset.setValue("SEO", new Double(30.5D)); // defaultpiedataset.setValue("Redes", new Double(2.0D)); // Creando el Grafico JFreeChart chart = ChartFactory.createPieChart3D("Informe De Asignacin De Clases", defaultpiedataset, true, true, false); PiePlot3D pieplot3d = (PiePlot3D) chart.getPlot(); pieplot3d.setDepthFactor(0.5); pieplot3d.setStartAngle(290D); pieplot3d.setDirection(Rotation.CLOCKWISE); pieplot3d.setForegroundAlpha(0.5F); // Mostrar Grafico ChartPanel chartPanel = new ChartPanel(chart); panel.add(chartPanel); }
From source file:BrowserAverage.java
private JFreeChart createChart(PieDataset dataset, String title) { JFreeChart chart = ChartFactory.createPieChart3D(title, dataset, true, true, false); PiePlot3D plot = (PiePlot3D) chart.getPlot(); plot.setStartAngle(0); plot.setDirection(Rotation.ANTICLOCKWISE); plot.setForegroundAlpha(0.5f);/* w ww . j av a 2s . c o m*/ rotator = new Rotator(plot, 0); rotator.start(); return chart; }
From source file:org.pentaho.reporting.engine.classic.demo.ancient.demo.chartdemo.BasicExtXmlChartDemo.java
/** * Creates a sample chart./*from w w w .j ava 2s . co m*/ * * @param dataset the dataset. * @return A chart. */ private JFreeChart createChart(final PieDataset dataset) { final JFreeChart chart = ChartFactory.createPieChart3D("Pie Chart 3D Demo 1", // chart title dataset, // data true, // include legend true, false); // set the background color for the chart... chart.setBackgroundPaint(Color.yellow); final PiePlot3D plot = (PiePlot3D) chart.getPlot(); plot.setStartAngle(270); // plot.setDirection(Rotation.CLOCKWISE); plot.setForegroundAlpha(0.5f); plot.setNoDataMessage("No data to display"); return chart; }
From source file:org.mt4jx.components.visibleComponents.widgets.jfreechart.examples.MTJFreeChartExampleScene.java
public MTJFreeChartExampleScene(MTApplication mtApplication, String name) { super(mtApplication, name); this.setClearColor(new MTColor(0, 0, 96, 255)); //Show touches this.registerGlobalInputProcessor(new CursorTracer(mtApplication, this)); // Create Example Data DefaultCategoryDataset dataset = new DefaultCategoryDataset(); for (int i = 0; i < 10; i++) { dataset.addValue(10 * Math.random(), "MySeries", "T" + i); }/* w w w .ja va 2 s .c o m*/ // Create a JFreeChart JFreeChart chart1 = ChartFactory.createLineChart("Line Chart", "x axis", "y axis", dataset, PlotOrientation.VERTICAL, true, true, false); // Put the JFreeChart into a MTJFreeChart wrapper MTJFreeChart mtChart1 = new MTJFreeChart(800, 600, mtApplication, chart1); // Create another chart DefaultPieDataset pds = new DefaultPieDataset(); pds.setValue("Java", new Double(17.773)); pds.setValue("C", new Double(15.822)); pds.setValue("C++", new Double(8.783)); pds.setValue("PHP", new Double(7.835)); pds.setValue("Python", new Double(6.265)); pds.setValue("C#", new Double(6.226)); pds.setValue("(Visual) Basic", new Double(5.867)); pds.setValue("Objective-C", new Double(3.011)); pds.setValue("Perl", new Double(2.857)); JFreeChart chart2 = ChartFactory.createPieChart3D( "Top 10: TIOBE Programming Community Index\nfor January 2011 (www.tiobe.com)", pds, true, true, Locale.GERMANY); PiePlot3D plot = (PiePlot3D) chart2.getPlot(); plot.setStartAngle(290); MTJFreeChart mtChart2 = new MTJFreeChart(800, 600, mtApplication, chart2); // enable redraw of the chart when it's scaled by the user mtChart2.setRedrawWhenScaled(true); this.getCanvas().addChild(mtChart1); this.getCanvas().addChild(mtChart2); mtChart1.setPositionGlobal(new Vector3D(mtApplication.width / 2f, mtApplication.height / 2f)); mtChart2.setPositionGlobal(new Vector3D(150 + mtApplication.width / 2f, 150 + mtApplication.height / 2f)); }
From source file:org.shredzone.bullshitcharts.chart.ChoicePieGenerator.java
@Override public Plot generate() { PieDatasetCreator dataset = new PieDatasetCreator(); String choice1 = getValue("c1", ""); String choice2 = getValue("c2", null); String choice3 = getValue("c3", null); String choice4 = getValue("c4", null); String choice5 = getValue("c5", null); dataset.addChoice(choice1);/*from w ww .j a v a2 s. c o m*/ dataset.setFavouriteChoice(choice1); if (choice2 != null) dataset.addChoice(choice2); if (choice3 != null) dataset.addChoice(choice3); if (choice4 != null) dataset.addChoice(choice4); if (choice5 != null) dataset.addChoice(choice5); dataset.setTendency(getTendency()); PiePlot3D plot = new PiePlot3D(dataset.generate()); plot.setCircular(true); plot.setStartAngle(110d); plot.setForegroundAlpha(0.6f); plot.setDarkerSides(true); plot.setOutlineVisible(false); return plot; }
From source file:org.jfree.chart.demo.PieChart3DDemo4.java
/** * Creates a sample chart.//from w w w .j av a 2 s.c om * * @param dataset the dataset. * * @return A chart. */ private JFreeChart createChart(final PieDataset dataset) { final JFreeChart chart = ChartFactory.createPieChart3D("Pie Chart 3D Demo 4", // chart title dataset, // data true, // include legend true, false); final PiePlot3D plot = (PiePlot3D) chart.getPlot(); plot.setStartAngle(290); plot.setDirection(Rotation.CLOCKWISE); plot.setForegroundAlpha(0.5f); plot.setNoDataMessage("No data to display"); plot.setLabelGenerator(new CustomLabelGenerator()); 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)); }