Example usage for org.jfree.chart.plot FastXYPlot getRangeAxis

List of usage examples for org.jfree.chart.plot FastXYPlot getRangeAxis

Introduction

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

Prototype

public ValueAxis getRangeAxis() 

Source Link

Document

Returns the range axis for the plot.

Usage

From source file:de.uniol.ui.tsv.ui.LineChartDialog.java

/**
 * @return the resulting chart object//ww  w .j  a va  2 s. com
 */
protected JFreeChart createChart() {
    JFreeChart chart = ChartFactory.createTimeSeriesChartFast(title, xTitle, yTitle, xy, true, false, false);

    chart.setBackgroundPaint(Color.white);
    chart.getLegend().setBackgroundPaint(new Color(224, 224, 224));

    FastXYPlot plot = (FastXYPlot) chart.getPlot();
    //      plot.setBackgroundPaint(new Color(224, 224, 224));
    plot.setBackgroundPaint(new Color(77, 77, 77));
    plot.setDomainGridlinePaint(Color.lightGray);
    plot.setRangeGridlinePaint(Color.lightGray);
    plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0));
    StandardXYItemRendererFast r = new StandardXYItemRendererFast(StandardXYItemRendererFast.LINES, null, null);
    plot.setRenderer(r);

    for (int i : seriesStrokes.keySet()) {
        r.setSeriesStroke(i, seriesStrokes.get(i));
    }
    for (int i : seriesColors.keySet()) {
        r.setSeriesPaint(i, seriesColors.get(i));
    }

    DateAxis da = new DateAxis(xTitle);
    if (useRelativeHourFormat) {
        da.setDateFormatOverride(new RelativeHourFormat());
    }
    da.setLowerMargin(0.03);
    plot.setDomainAxis(da);

    if (minRange != 0.0 && maxRange != 0.0) {
        ValueAxis yaxis = plot.getRangeAxis();
        yaxis.setRange(new Range(minRange, maxRange));
    }

    return chart;
}