Example usage for org.jfree.chart.plot PolarPlot PolarPlot

List of usage examples for org.jfree.chart.plot PolarPlot PolarPlot

Introduction

In this page you can find the example usage for org.jfree.chart.plot PolarPlot PolarPlot.

Prototype

public PolarPlot(XYDataset dataset, ValueAxis radiusAxis, PolarItemRenderer renderer) 

Source Link

Document

Creates a new plot.

Usage

From source file:be.ugent.maf.cellmissy.gui.controller.analysis.singlecell.SingleCellAnalysisController.java

/**
 * Render the rose plots for given datasets.
 *
 * @param datasets/*from w  w  w .ja v  a 2  s  .c om*/
 */
private void renderRosePlots(List<XYSeriesCollection> datasets) {
    rosePlotChartPanels.clear();
    analysisPanel.getRosePlotParentPanel().removeAll();
    for (int i = 0; i < datasets.size(); i++) {
        XYSeriesCollection dataset = datasets.get(i);
        // create a new polar plot with this dataset, and set the custom renderer
        PolarPlot rosePlot = new PolarPlot(dataset, new NumberAxis(), new AngularHistogramRenderer(i, 5));
        // create a new chart with this plot
        JFreeChart chart = new JFreeChart("", JFreeChart.DEFAULT_TITLE_FONT, rosePlot, false);
        JFreeChartUtils.setupPolarChart(chart, i);
        ChartPanel rosePlotChartPanel = new ChartPanel(chart);
        rosePlotChartPanels.add(rosePlotChartPanel);
        // compute the constraints
        GridBagConstraints tempConstraints = getGridBagConstraints(datasets.size(), i);
        analysisPanel.getRosePlotParentPanel().add(rosePlotChartPanel, tempConstraints);
        analysisPanel.getRosePlotParentPanel().revalidate();
        analysisPanel.getRosePlotParentPanel().repaint();
    }
}

From source file:be.ugent.maf.cellmissy.gui.controller.analysis.singlecell.AngleDirectController.java

/**
 * Render polar plots for given datasets.
 *
 * @param datasets//from   ww w  .  jav  a  2 s. c o 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:be.ugent.maf.cellmissy.gui.controller.analysis.singlecell.AngleDirectController.java

/**
 * Render the rose plots for given datasets.
 *
 * @param datasets/*from   ww w.  j  a va 2  s.  c  o  m*/
 */
private void renderRosePlots(List<XYSeriesCollection> datasets) {
    rosePlotChartPanels.clear();
    turningAnglePanel.getRosePlotParentPanel().removeAll();
    for (int i = 0; i < datasets.size(); i++) {
        XYSeriesCollection dataset = datasets.get(i);
        // create a new polar plot with this dataset, and set the custom renderer
        PolarPlot rosePlot = new PolarPlot(dataset, new NumberAxis(), new AngularHistogramRenderer(i, 5));
        // create a new chart with this plot
        JFreeChart chart = new JFreeChart("", JFreeChart.DEFAULT_TITLE_FONT, rosePlot, false);
        JFreeChartUtils.setupPolarChart(chart, i);
        ChartPanel rosePlotChartPanel = new ChartPanel(chart);
        rosePlotChartPanels.add(rosePlotChartPanel);
        // compute the constraints
        GridBagConstraints tempConstraints = getGridBagConstraints(datasets.size(), i);
        turningAnglePanel.getRosePlotParentPanel().add(rosePlotChartPanel, tempConstraints);
        turningAnglePanel.getRosePlotParentPanel().revalidate();
        turningAnglePanel.getRosePlotParentPanel().repaint();
    }
}

From source file:be.ugent.maf.cellmissy.gui.controller.analysis.singlecell.AngleDirectController.java

/**
 *
 * @param datasets/*from  w  w w. java 2 s.  com*/
 */
private void renderCompassPlots(List<XYSeriesCollection> datasets) {
    turningAnglePanel.getCompassPlotParentPanel().removeAll();
    for (int i = 0; i < datasets.size(); i++) {
        XYSeriesCollection dataset = datasets.get(i);
        // create a new polar plot with this dataset, and set the custom renderer
        PolarPlot polarPlot = new PolarPlot(dataset, new NumberAxis(), new CompassRenderer(i));
        // create a new chart with this plot
        JFreeChart chart = new JFreeChart("", JFreeChart.DEFAULT_TITLE_FONT, polarPlot, true);
        JFreeChartUtils.setupPolarChart(chart, i);
        ChartPanel compassChartPanel = new ChartPanel(chart);
        // compute the constraints
        GridBagConstraints tempConstraints = getGridBagConstraints(datasets.size(), i);
        turningAnglePanel.getCompassPlotParentPanel().add(compassChartPanel, tempConstraints);
        turningAnglePanel.getCompassPlotParentPanel().revalidate();
        turningAnglePanel.getCompassPlotParentPanel().repaint();
    }
}