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

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

Introduction

In this page you can find the example usage for org.jfree.chart.axis DateAxis 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:cs.gui.stats.PerformanceStats.java

private void setScope(int type, String strSelectedItemValue, ValueAxis valueAxis, DateAxis dateAxis) {
    long scope = 0;

    if (strSelectedItemValue.equals("All")) {
        scope = 0;/*from  w  w w. ja va  2s. co m*/
    } else if (strSelectedItemValue.equals("One Day")) {
        scope = 86500;
    } else if (strSelectedItemValue.equals("Ten Days")) {
        scope = 865000;
    } else if (strSelectedItemValue.equals("One Month")) {
        scope = 2600000;
    } else if (strSelectedItemValue.equals("Two Months")) {
        scope = 2 * 2600000;
    } else if (strSelectedItemValue.equals("Four Months")) {
        scope = 4 * 2600000;
    } else if (strSelectedItemValue.equals("Six Months")) {
        scope = 6 * 2600000;
    } else if (strSelectedItemValue.equals("Ten Months")) {
        scope = 10 * 2600000;
    } else if (strSelectedItemValue.equals("One Year")) {
        scope = 12 * 2600000;
    }

    //set the values based on scope
    if (scope == 0) {
        valueAxis.setAutoRange(true);
        dateAxis.setMinimumDate(initialDateRange.getLowerDate());
    } else {
        valueAxis.setAutoRange(true);
        valueAxis.setFixedAutoRange(scope);
    }

    switch (type) {
    case 1: {
        scope1 = scope;
    }
        break;
    case 2: {
        scope2 = scope;
    }
        break;
    case 3: {
        scope3 = scope;
    }
        break;
    case 4: {
        scope4 = scope;
    }
        break;
    case 5: {
        scope5 = scope;
    }
        break;
    }
}