Example usage for org.jfree.chart.axis ValueAxis setRange

List of usage examples for org.jfree.chart.axis ValueAxis setRange

Introduction

In this page you can find the example usage for org.jfree.chart.axis ValueAxis setRange.

Prototype

public void setRange(double lower, double upper) 

Source Link

Document

Sets the range for the axis and sends a change event to all registered listeners.

Usage

From source file:org.jfree.chart.ChartFactory.java

/**
 * Creates a wind plot with default settings.
 *
 * @param title  the chart title (<code>null</code> permitted).
 * @param xAxisLabel  a label for the x-axis (<code>null</code> permitted).
 * @param yAxisLabel  a label for the y-axis (<code>null</code> permitted).
 * @param dataset  the dataset for the chart (<code>null</code> permitted).
 *
 * @return A wind plot./*from  ww  w.  j  a  va2s . c  om*/
 */
public static JFreeChart createWindPlot(String title, String xAxisLabel, String yAxisLabel,
        WindDataset dataset) {

    ValueAxis xAxis = new DateAxis(xAxisLabel);
    ValueAxis yAxis = new NumberAxis(yAxisLabel);
    yAxis.setRange(-12.0, 12.0);

    WindItemRenderer renderer = new WindItemRenderer();
    renderer.setDefaultToolTipGenerator(new StandardXYToolTipGenerator());
    XYPlot plot = new XYPlot(dataset, xAxis, yAxis, renderer);
    JFreeChart chart = new JFreeChart(title, plot);
    currentTheme.apply(chart);
    return chart;

}