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

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

Introduction

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

Prototype

public StackedXYPlot(ValueAxis domainAxis) 

Source Link

Document

Creates a new stacked plot that allows having own domain axis among multiple subplots subplots.

Usage

From source file:no.met.jtimeseries.marinogram.MarinogramWrapper.java

@Override
public XYPlot getPlot() throws ParseException {
    //extra check to avoid add plots on multiple getPlot calls
    if (combiPlot != null) {
        return combiPlot;
    }//from www.j a v  a 2s .  c  om
    for (int i = plots.size() - 1; i >= 0; i--) {
        MarinogramPlot marinogramPlot = plots.get(i);
        XYPlot plot = marinogramPlot.getPlot();

        if (combiPlot == null) {
            // create a stacked plot with the domain axis of the first plot
            combiPlot = new StackedXYPlot(plot.getDomainAxis());
            combiPlot.setGap(0.0d);
        }
        if (plot != null) {
            ExtendedDateAxis xAxis = (ExtendedDateAxis) plot.getDomainAxis();
            xAxis.setAxislineExtended(true);

            if (i == 0) {
                xAxis.setTickLabelsVisible(true);
            }
            combiPlot.add(plot, marinogramPlot.getHeight());
        }
    }

    return combiPlot;
}