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

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

Introduction

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

Prototype

public void setMinimumDate(Date date) 

Source Link

Document

Sets the minimum 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./* ww  w  .jav a2 s .c  o m*/
 * 
 * @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);
}