Example usage for org.jfree.chart.axis ExtendedDateAxis setMaximumDate

List of usage examples for org.jfree.chart.axis ExtendedDateAxis setMaximumDate

Introduction

In this page you can find the example usage for org.jfree.chart.axis ExtendedDateAxis setMaximumDate.

Prototype

public void setMaximumDate(Date maximumDate) 

Source Link

Document

Sets the maximum date visible on the axis and sends an AxisChangeEvent to all registered listeners.

Usage

From source file:no.met.jtimeseries.chart.ChartPlotter.java

/**
 * Set the range of the domain axis./*from  ww w.ja v a  2  s  .c  om*/
 * 
 * @param minDate
 *            The minimum date value for the domain axis.
 * @param maxDate
 *            The maximum date value for the domain axis.
 */
public void setDomainRange(Date minDate, Date maxDate) {

    ValueAxis domainAxis = plot.getDomainAxis();
    if (!(domainAxis instanceof DateAxis)) {
        throw new IllegalStateException("Domain axis was not a DateAxis");
    }

    ExtendedDateAxis dateAxis = (ExtendedDateAxis) domainAxis;
    dateAxis.setMinimumDate(minDate);
    dateAxis.setMaximumDate(maxDate);

    // if this was not set the first tick would not be calculated correctly for the long
    // term meteogram, but it would be one hour of.
    dateAxis.setStartDate(minDate);
}