List of usage examples for org.jfree.chart.renderer DefaultPolarItemRenderer DefaultPolarItemRenderer
public DefaultPolarItemRenderer()
From source file:org.hxzon.demo.jfreechart.PolarChartDemo.java
private static JFreeChart createPolarChart(XYDataset dataset) { boolean legend = true; PolarPlot plot = new PolarPlot(); plot.setDataset(dataset);// www. j a v a2 s . c o m NumberAxis rangeAxis = new NumberAxis(); rangeAxis.setAxisLineVisible(false); rangeAxis.setTickMarksVisible(false); rangeAxis.setTickLabelInsets(new RectangleInsets(0.0, 0.0, 0.0, 0.0)); plot.setAxis(rangeAxis); plot.setRenderer(new DefaultPolarItemRenderer()); JFreeChart chart = new JFreeChart("Polar Chart Demo", JFreeChart.DEFAULT_TITLE_FONT, plot, legend); chart.setBackgroundPaint(Color.white); plot.setBackgroundPaint(Color.lightGray); plot.setAngleGridlinesVisible(true); plot.setAngleLabelsVisible(true); plot.setAngleTickUnit(new NumberTickUnit(5)); return chart; }
From source file:msi.gama.outputs.layers.charts.ChartJFreeChartOutputPie.java
@Override protected AbstractRenderer createRenderer(final IScope scope, final String serieid) { final String style = this.getChartdataset().getDataSeries(scope, serieid).getStyle(scope); AbstractRenderer newr = new DefaultPolarItemRenderer(); switch (style) { case IKeyword.STACK: case IKeyword.THREE_D: case IKeyword.WHISKER: case IKeyword.AREA: case IKeyword.BAR: case IKeyword.STEP: case IKeyword.RING: case IKeyword.EXPLODED: default: {// w w w. j a v a2s . c om newr = new DefaultPolarItemRenderer(); // useless, piechart doesn't // use renderers... break; } } return newr; }
From source file:eremeykin.pete.plotter.PolarPlotterTopComponent.java
JFreeChart createChart(XYDataset dataset) { final JFreeChart chart = ChartFactory.createPolarChart(" ?", dataset, true, true, false);/*w ww . j a va 2 s .com*/ chart.setBackgroundPaint(Color.white); plot = (PolarPlot) chart.getPlot(); plot.setBackgroundPaint(Color.WHITE); plot.setAngleGridlinePaint(Color.BLACK); plot.setRadiusGridlinePaint(Color.LIGHT_GRAY); final DefaultPolarItemRenderer renderer = new DefaultPolarItemRenderer(); renderer.setSeriesShape(1, ShapeUtilities.createDiamond(1)); renderer.setSeriesShape(2, ShapeUtilities.createDiamond(1)); renderer.setSeriesShape(3, ShapeUtilities.createDiamond(1)); renderer.setSeriesPaint(0, Color.RED); renderer.setSeriesPaint(1, Color.BLUE); renderer.setSeriesPaint(2, Color.BLUE); renderer.setSeriesPaint(3, Color.BLACK); plot.setRenderer(renderer); chart.setTitle(new org.jfree.chart.title.TextTitle(" ?", new java.awt.Font("Arial", java.awt.Font.PLAIN, 16))); return chart; }
From source file:org.hxzon.demo.jfreechart.XYDatasetDemo2.java
private static JFreeChart createPolarChart(XYDataset dataset) { PolarPlot plot = new PolarPlot(); plot.setDataset(dataset);// w ww .j av a 2 s .c o m NumberAxis rangeAxis = new NumberAxis(); rangeAxis.setAxisLineVisible(false); rangeAxis.setTickMarksVisible(false); rangeAxis.setTickLabelInsets(new RectangleInsets(0.0, 0.0, 0.0, 0.0)); plot.setAxis(rangeAxis); plot.setRenderer(new DefaultPolarItemRenderer()); JFreeChart chart = new JFreeChart("Polar Chart Demo", JFreeChart.DEFAULT_TITLE_FONT, plot, legend); chart.setBackgroundPaint(Color.white); plot.setBackgroundPaint(Color.lightGray); return chart; }
From source file:be.ugent.maf.cellmissy.gui.controller.analysis.singlecell.AngleDirectController.java
/** * Render polar plots for given datasets. * * @param datasets/*from w w w. jav a2s .co m*/ */ private void renderPolarPlots(List<XYSeriesCollection> datasets) { turningAnglePanel.getPolarPlotParentPanel().removeAll(); for (int i = 0; i < datasets.size(); i++) { XYSeriesCollection dataset = datasets.get(i); // create a new polar plot with this dataset PolarPlot polarPlot = new PolarPlot(dataset, new NumberAxis(), new DefaultPolarItemRenderer()); // create a new chart with this plot JFreeChart chart = new JFreeChart("", JFreeChart.DEFAULT_TITLE_FONT, polarPlot, true); JFreeChartUtils.setupPolarChart(chart, i); ChartPanel polarChartPanel = new ChartPanel(chart); // compute the constraints GridBagConstraints tempConstraints = getGridBagConstraints(datasets.size(), i); turningAnglePanel.getPolarPlotParentPanel().add(polarChartPanel, tempConstraints); turningAnglePanel.getPolarPlotParentPanel().revalidate(); turningAnglePanel.getPolarPlotParentPanel().repaint(); } }
From source file:org.hxzon.demo.jfreechart.OtherDatasetDemo.java
private static JFreeChart createPolarChart(XYDataset dataset) { PolarPlot plot = new PolarPlot(); plot.setDataset(dataset);//from www. j a v a 2 s .c om NumberAxis rangeAxis = new NumberAxis(); rangeAxis.setAxisLineVisible(false); rangeAxis.setTickMarksVisible(false); rangeAxis.setTickLabelInsets(new RectangleInsets(0.0, 0.0, 0.0, 0.0)); plot.setAxis(rangeAxis); plot.setRenderer(new DefaultPolarItemRenderer()); JFreeChart chart = new JFreeChart("Polar Chart Demo", JFreeChart.DEFAULT_TITLE_FONT, plot, legend); chart.setBackgroundPaint(Color.white); plot.setBackgroundPaint(Color.lightGray); plot.setAngleGridlinesVisible(true); plot.setAngleLabelsVisible(true); plot.setAngleTickUnit(new NumberTickUnit(5)); return chart; }
From source file:edu.dlnu.liuwenpeng.ChartFactory.ChartFactory.java
/** * Creates a polar plot for the specified dataset (x-values interpreted as * angles in degrees). The chart object returned by this method uses a * {@link PolarPlot} instance as the plot, with a {@link NumberAxis} for * the radial axis. //from w ww . j ava 2 s . c o m * * @param title the chart title (<code>null</code> permitted). * @param dataset the dataset (<code>null</code> permitted). * @param legend legend required? * @param tooltips tooltips required? * @param urls URLs required? * * @return A chart. */ public static JFreeChart createPolarChart(String title, XYDataset dataset, boolean legend, boolean tooltips, boolean urls) { PolarPlot plot = new PolarPlot(); plot.setDataset(dataset); NumberAxis rangeAxis = new NumberAxis(); rangeAxis.setAxisLineVisible(false); rangeAxis.setTickMarksVisible(false); rangeAxis.setTickLabelInsets(new RectangleInsets(0.0, 0.0, 0.0, 0.0)); plot.setAxis(rangeAxis); plot.setRenderer(new DefaultPolarItemRenderer()); JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend); return chart; }
From source file:KIDLYFactory.java
/** * Creates a polar plot for the specified dataset (x-values interpreted as * angles in degrees). The chart object returned by this method uses a * {@link PolarPlot} instance as the plot, with a {@link NumberAxis} for * the radial axis.// w ww .j a v a2 s. c o m * * @param title the chart title (<code>null</code> permitted). * @param dataset the dataset (<code>null</code> permitted). * @param legend legend required? * @param tooltips tooltips required? * @param urls URLs required? * * @return A chart. */ public static JFreeChart createPolarChart(String title, XYDataset dataset, boolean legend, boolean tooltips, boolean urls) { PolarPlot plot = new PolarPlot(); plot.setDataset(dataset); NumberAxis rangeAxis = new NumberAxis(); rangeAxis.setAxisLineVisible(false); rangeAxis.setTickMarksVisible(false); rangeAxis.setTickLabelInsets(new RectangleInsets(0.0, 0.0, 0.0, 0.0)); plot.setAxis(rangeAxis); plot.setRenderer(new DefaultPolarItemRenderer()); JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend); currentTheme.apply(chart); return chart; }
From source file:org.jfree.chart.ChartFactory.java
/** * Creates a polar plot for the specified dataset (x-values interpreted as * angles in degrees). The chart object returned by this method uses a * {@link PolarPlot} instance as the plot, with a {@link NumberAxis} for * the radial axis.//from w w w . jav a 2 s .c o m * * @param title the chart title (<code>null</code> permitted). * @param dataset the dataset (<code>null</code> permitted). * * @return A chart. */ public static JFreeChart createPolarChart(String title, XYDataset dataset) { PolarPlot plot = new PolarPlot(); plot.setDataset(dataset); NumberAxis rangeAxis = new NumberAxis(); rangeAxis.setAxisLineVisible(false); rangeAxis.setTickMarksVisible(false); rangeAxis.setTickLabelInsets(new RectangleInsets(0.0, 0.0, 0.0, 0.0)); plot.setAxis(rangeAxis); plot.setRenderer(new DefaultPolarItemRenderer()); JFreeChart chart = new JFreeChart(title, plot); currentTheme.apply(chart); return chart; }