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

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

Introduction

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

Prototype

public void setStartDate(Date startDate) 

Source Link

Usage

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

/**
 * Set the range of the domain axis.//from   www. j a  v a  2s  .  com
 * 
 * @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);
}