Example usage for org.jfree.chart.plot PlotOrientation VERTICAL

List of usage examples for org.jfree.chart.plot PlotOrientation VERTICAL

Introduction

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

Prototype

PlotOrientation VERTICAL

To view the source code for org.jfree.chart.plot PlotOrientation VERTICAL.

Click Source Link

Document

For a plot where the range axis is vertical.

Usage

From source file:it.unibo.alchemist.boundary.gui.asmc.SimplePlot.java

@Override
public void batchDone(final double[][] values, final double lower, final double upper, final int sampleSize) {
    this.removeAll();
    final YIntervalSeries series = new YIntervalSeries("Probability of condition satisfaction vs. time");
    for (final double[] value : values) {
        series.add(value[0], value[1], value[2], value[TRE]);
    }/*from w  w  w  .j  a va 2s .  c o m*/
    final YIntervalSeriesCollection data = new YIntervalSeriesCollection();
    data.addSeries(series);
    final JFreeChart chart = ChartFactory.createXYLineChart("", "X", "Y", data, PlotOrientation.VERTICAL, true,
            true, false);
    XYItemRenderer renderer;
    switch (currentRenderer) {
    case 1:
        renderer = new YIntervalRenderer();
        break;
    case 0:
    default:
        renderer = new DeviationRenderer(true, false);
    }
    final XYPlot plot = (XYPlot) chart.getPlot();
    plot.setRenderer(renderer);
    plot.getDomainAxis().setLowerBound(lower);
    plot.getDomainAxis().setUpperBound(upper);
    plot.getRangeAxis().setUpperBound(1.0);
    plot.getRangeAxis().setLowerBound(0.0);

    final ChartPanel chartPanel = new ChartPanel(chart);
    chartPanel.setPreferredSize(DIMENSION);
    this.setLayout(new BorderLayout());
    this.add(chartPanel, BorderLayout.NORTH);
    SwingUtilities.invokeLater(new Runnable() {
        @Override
        public void run() {
            chartPanel.getRootPane().validate();
        }
    });
}

From source file:org.esa.beam.smos.visat.GridPointBtDataChartToolView.java

@Override
protected JComponent createGridPointComponent() {
    coPolDataset = new YIntervalSeriesCollection();
    crossPolDataset = new YIntervalSeriesCollection();
    chart = ChartFactory.createXYLineChart(null, null, null, coPolDataset, PlotOrientation.VERTICAL, true, // Legend?
            true, false);/*  www.ja  v a2 s .  c o  m*/

    plot = chart.getXYPlot();
    plot.setNoDataMessage("No data");
    plot.setAxisOffset(new RectangleInsets(5, 5, 5, 5));

    final NumberAxis xAxis = (NumberAxis) plot.getDomainAxis();
    xAxis.setLabel("Incidence Angle (deg)");
    xAxis.setRange(0, 70);
    xAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());

    final NumberAxis yAxis = (NumberAxis) plot.getRangeAxis();
    yAxis.setLabel("Co-Pol BT(K)");
    yAxis.setRange(50, 350);

    final NumberAxis yAxis2 = new NumberAxis("Cross-Pol BT(K)");
    yAxis2.setRange(-25, 25);
    plot.setRangeAxis(1, yAxis2);
    plot.setDataset(1, crossPolDataset);
    plot.mapDatasetToRangeAxis(1, 1);

    DeviationRenderer coPolRenderer = new DeviationRenderer(true, false);
    coPolRenderer.setSeriesFillPaint(0, new Color(255, 127, 127));
    coPolRenderer.setSeriesFillPaint(1, new Color(127, 127, 255));
    DeviationRenderer crossPolRenderer = new DeviationRenderer(true, false);
    crossPolRenderer.setSeriesFillPaint(0, new Color(127, 255, 127));
    crossPolRenderer.setSeriesFillPaint(1, new Color(255, 255, 127));
    plot.setRenderer(0, coPolRenderer);
    plot.setRenderer(1, crossPolRenderer);

    return new ChartPanel(chart);
}

From source file:gui.DendrogramChart.java

ChartPanel getChartPanel(Dendrogram d, boolean log) {
    JFreeChart chart = ChartFactory.createXYLineChart(null, "Similarity", "No. of Groups", null,
            PlotOrientation.VERTICAL, true, true, false);

    setChartData(chart, log);/*from  w w w .j  a va  2  s . c om*/

    RenderingHints rh = new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
    chart.setRenderingHints(rh);
    chart.removeLegend();

    XYPlot plot = chart.getXYPlot();
    plot.setBackgroundPaint(new Color(255, 255, 220));
    plot.setDomainGridlinePaint(new Color(128, 128, 128));
    plot.setRangeGridlinePaint(new Color(128, 128, 128));
    if (log == false) {
        NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
        rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
        rangeAxis.setLowerBound(0);
        rangeAxis.setNumberFormatOverride(new DecimalFormat("0"));
        rangeAxis.setLabelFont(Prefs.labelFont);
    } else {
        // LogarithmicAxis logXAxis = new LogarithmicAxis("Similarity");
        // logXAxis.setAllowNegativesFlag(true);
        LogarithmicAxis logYAxis = new LogarithmicAxis("No. Of Groups");
        logYAxis.setAllowNegativesFlag(false);

        // plot.setDomainAxis(logXAxis);
        plot.setRangeAxis(logYAxis);
    }

    ChartPanel chartPanel = new ChartPanel(chart);
    // chartPanel.setPopupMenu(null);
    return chartPanel;
}

From source file:com.googlecode.logVisualizer.chart.VerticalXYBarChartBuilder.java

private JFreeChart createChart(final IntervalXYDataset dataset) {
    final JFreeChart chart = ChartFactory.createXYBarChart(getTitle(), xLable, false, yLable, dataset,
            PlotOrientation.VERTICAL, isIncludeLegend(), true, false);
    final XYPlot plot = (XYPlot) chart.getPlot();
    final NumberAxis yAxis = (NumberAxis) plot.getRangeAxis();

    double lastXValue = 0;
    if (dataset.getSeriesCount() > 0)
        lastXValue = dataset.getXValue(0, dataset.getItemCount(0) - 1);

    plot.setDomainAxis(new FixedZoomNumberAxis(lastXValue));
    plot.setNoDataMessage("No data available");
    plot.setBackgroundPaint(Color.white);
    plot.setRangeGridlinePaint(Color.black);
    plot.setRangeAxisLocation(AxisLocation.BOTTOM_OR_LEFT);
    setBarShadowVisible(chart, false);/*from   www  .ja  v a2  s  . co m*/

    plot.getDomainAxis().setStandardTickUnits(NumberAxis.createIntegerTickUnits());
    if (dataset.getSeriesCount() > 0)
        plot.getDomainAxis().setUpperBound(lastXValue);
    plot.getDomainAxis().setLowerBound(0);
    yAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
    yAxis.setUpperMargin(0.1);

    return chart;
}

From source file:playground.yu.utils.charts.BubbleChart.java

private JFreeChart createChart(String title, String xAxisLabel, String yAxisLabel, XYZDataset dataset) {
    return ChartFactory.createBubbleChart(title, xAxisLabel, yAxisLabel, dataset, PlotOrientation.VERTICAL, true// legend?
            , false// tooltips?
            , false// URLs?
    );//from   w ww  .  java  2s .c  om
}

From source file:flusim.XY_Plotter.java

/**
 * Creates a chart.//from   w ww .  jav a2  s.co m
 * 
 * @param dataset  a dataset.
 * 
 * @return A chart.
 */
private static JFreeChart createChart(XYDataset dataset, String title) {

    JFreeChart chart = ChartFactory.createXYLineChart(title, // Title
            "Seconds Post Infection", // x-axis Label
            "Count", // y-axis Label
            dataset, // Dataset
            PlotOrientation.VERTICAL, // Plot Orientation
            true, // Show Legend
            true, // Use tooltips
            false // Configure chart to generate URLs?
    );
    try {

        ChartUtilities.saveChartAsPNG(new File(title + "-" + getDateTime() + ".png"), chart, 800, 640);

    } catch (IOException e) {
        System.err.println("Problem occurred creating chart.");
    }

    chart.setBackgroundPaint(Color.white);

    return chart;

}

From source file:openomr.dataanalysis.XYChart.java

public XYChart(int data[], int size, String name) {
    XYSeries series = new XYSeries(name);
    for (int i = 0; i < size; i += 1)
        series.add(i, data[i]);//from  w ww  . j  a  va  2 s  . co m
    XYDataset xyDataset = new XYSeriesCollection(series);

    chart = ChartFactory.createXYAreaChart(name, "width", "# Pixels", xyDataset, PlotOrientation.VERTICAL, true,
            false, false);

}

From source file:umontreal.iro.lecuyer.charts.HistogramChart.java

protected void init(String title, String XLabel, String YLabel) {
    // create the chart...
    chart = ChartFactory.createXYLineChart(title, // chart title
            XLabel, // x axis label
            YLabel, // y axis label
            dataset.getSeriesCollection(), // data
            PlotOrientation.VERTICAL, true, // include legend
            true, // tooltips
            false // urls
    );/*from  w  ww.  j a  va  2 s.  com*/
    ((XYPlot) chart.getPlot()).setRenderer(dataset.getRenderer());
    //Initialize axis variables
    XAxis = new Axis((NumberAxis) ((XYPlot) chart.getPlot()).getDomainAxis(), Axis.ORIENTATION_HORIZONTAL);
    YAxis = new Axis((NumberAxis) ((XYPlot) chart.getPlot()).getRangeAxis(), Axis.ORIENTATION_VERTICAL);
    setAutoRange(false, true, true, true);
}

From source file:edu.memphis.ccrg.lida.framework.gui.panels.ActivationChartPanel.java

/** Creates new form JChartGuiPanel */
public ActivationChartPanel() {
    chart = ChartFactory.createXYLineChart("", "Tick", "Activation", dataset, PlotOrientation.VERTICAL, true,
            true, false);/*from   w  ww . j  av a 2s  . c  om*/
    chart.setBackgroundPaint(new Color(238, 233, 233));
    XYPlot plot = (XYPlot) chart.getPlot();
    plot.setBackgroundPaint(Color.WHITE);
    plot.setDomainGridlinePaint(Color.LIGHT_GRAY);
    plot.setRangeGridlinePaint(Color.LIGHT_GRAY);
    NumberAxis domainAxis = (NumberAxis) plot.getDomainAxis();
    domainAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());

    initComponents();
}

From source file:com.planetmayo.debrief.satc.util.StraightLineCullingTestForm.java

private void createChart() {
    collections = new XYSeriesCollection();
    chart = ChartFactory.createXYLineChart("main", "x", "y", collections, PlotOrientation.VERTICAL, false,
            false, false);// ww  w  .  ja v  a 2  s . co m

    ChartPanel panel = new ChartPanel(chart);
    panel.setPreferredSize(new Dimension(800, 600));
    setContentPane(panel);
}