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

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

Introduction

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

Prototype

public void setTickMarkInsideLength(float length) 

Source Link

Document

Sets the inside length of the tick marks and sends an AxisChangeEvent to all registered listeners.

Usage

From source file:userinterface.graph.Graph.java

/** Refactored out from load(), parses an Axis. */
public static void parseAxis(ValueAxis axis, String minValue, String maxValue, String majorGridInterval,
        String minorGridInterval) {
    double min, max, major, minor;

    // can't work with null axis
    if (axis == null)
        return;/*from www .  ja va2 s. c  om*/

    try {
        min = Double.parseDouble(minValue);
    } catch (NumberFormatException e) {
        min = 0;
    }
    try {
        max = Double.parseDouble(maxValue);
    } catch (NumberFormatException e) {
        if (min < 1) {
            max = 1.0;
        } else {
            max = min + 1;
        }
    }
    try {
        major = Double.parseDouble(majorGridInterval);
    } catch (NumberFormatException e) {
        major = max / 5;
    }
    try {
        minor = Double.parseDouble(minorGridInterval);
    } catch (NumberFormatException e) {
        minor = major / 10;
    }

    // set parameters for axis
    axis.setLowerBound(min);
    axis.setUpperBound(max);
    axis.setTickMarkInsideLength((float) minor);
    axis.setTickMarkInsideLength((float) major);
}