org.jCharts.axisChart.axis

## Class Axis

- java.lang.Object
- - org.jCharts.axisChart.axis.Axis

- All Implemented Interfaces:
    Serializable, HTMLTestable
  Direct Known Subclasses:
    DataAxis, LabelAxis, XAxis, YAxis

      public abstract class Axis
      extends Object
      implements HTMLTestable, Serializable

  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private AxisChart` | `axisChart`
    `private TextTagGroup` | `axisLabelsGroup`
    `private float` | `minimumHeightNeeded`
    `private float` | `minimumWidthNeeded`
    `private int` | `numberOfScaleItems`
    `private double` | `oneUnitPixelSize`
    `private float` | `origin`
    `private float` | `pixelLength`
    `private ScaleCalculator` | `scaleCalculator`
    `private float` | `scalePixelWidth`
    `private float` | `tickStart`
    `private float` | `titleHeight`
    `private float` | `titleWidth`
    `private float` | `zeroLineCoordinate`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Axis(AxisChart axisChart, int numberOfScaleItems)` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `computeAxisTitleDimensions(String title, ChartFont axisTitleFont)`
    `void` | `computeOneUnitPixelSize(float scalePixelLength, double increment)` Computes the relationship of data point values to pixel values so know where along the axis a value is.
    `void` | `computeScalePixelWidth()` Computes the number of pixels between each value on the axis.
    `void` | `computeScalePixelWidthDataAxis()` Computes the number of pixels between each value on the axis.
    `AxisChart` | `getAxisChart()` Returns reference to AxisChart Object.
    `TextTagGroup` | `getAxisLabelsGroup()`
    `float` | `getMinimumHeightNeeded()`
    `float` | `getMinimumWidthNeeded()`
    `int` | `getNumberOfScaleItems()`
    `double` | `getOneUnitPixelSize()` Returns the number of pixels one value unit occupies.
    `float` | `getOrigin()`
    `float` | `getPixelLength()`
    `ScaleCalculator` | `getScaleCalculator()`
    `float` | `getScalePixelWidth()`
    `float` | `getTickStart()`
    `float` | `getTitleHeight()`
    `float` | `getTitleWidth()`
    `float` | `getZeroLineCoordinate()` Returns the screen coordinate of the zero line.
    `void` | `setAxisLabelsGroup(TextTagGroup axisLabelsGroup)`
    `void` | `setMinimumHeightNeeded(float minimumHeightNeeded)`
    `void` | `setMinimumWidthNeeded(float minimumWidthNeeded)`
    `void` | `setOneUnitPixelSize(double oneUnitPixelSize)`
    `void` | `setOrigin(float origin)`
    `void` | `setPixelLength(float pixelLength)`
    `void` | `setScaleCalculator(ScaleCalculator scaleCalculator)`
    `void` | `setScalePixelWidth(float scalePixelWidth)`
    `void` | `setTickStart(float tickStart)`
    `void` | `setZeroLineCoordinate(float value)` Sets the screen coordinate of the zero line.
    `void` | `toHTML(HTMLGenerator htmlGenerator)` Enables the testing routines to display the contents of this Object.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### axisChart

          private AxisChart axisChart

    - #### scalePixelWidth

          private float scalePixelWidth

    - #### pixelLength

          private float pixelLength

    - #### origin

          private float origin

    - #### titleHeight

          private float titleHeight

    - #### titleWidth

          private float titleWidth

    - #### minimumWidthNeeded

          private float minimumWidthNeeded

    - #### minimumHeightNeeded

          private float minimumHeightNeeded

    - #### axisLabelsGroup

          private TextTagGroup axisLabelsGroup

    - #### numberOfScaleItems

          private int numberOfScaleItems

    - #### tickStart

          private float tickStart

    - #### oneUnitPixelSize

          private double oneUnitPixelSize

    - #### zeroLineCoordinate

          private float zeroLineCoordinate

    - #### scaleCalculator

          private ScaleCalculator scaleCalculator

  - ### Constructor Detail

    - #### Axis

          public Axis(AxisChart axisChart,
                      int numberOfScaleItems)

      Constructor
      Parameters:
        `axisChart` -
        `numberOfScaleItems` -

  - ### Method Detail

    - #### getAxisChart

          public final AxisChart getAxisChart()

      Returns reference to AxisChart Object.
      Returns:
        axisChart

    - #### getNumberOfScaleItems

          public int getNumberOfScaleItems()

    - #### getAxisLabelsGroup

          public TextTagGroup getAxisLabelsGroup()

    - #### setAxisLabelsGroup

          public void setAxisLabelsGroup(TextTagGroup axisLabelsGroup)

    - #### getTitleWidth

          public final float getTitleWidth()

    - #### getTitleHeight

          public final float getTitleHeight()

    - #### getPixelLength

          public final float getPixelLength()

    - #### setPixelLength

          public final void setPixelLength(float pixelLength)

    - #### getOrigin

          public final float getOrigin()

    - #### setOrigin

          public final void setOrigin(float origin)

    - #### getMinimumWidthNeeded

          public final float getMinimumWidthNeeded()

    - #### setMinimumWidthNeeded

          public final void setMinimumWidthNeeded(float minimumWidthNeeded)

    - #### getMinimumHeightNeeded

          public final float getMinimumHeightNeeded()

    - #### setMinimumHeightNeeded

          public final void setMinimumHeightNeeded(float minimumHeightNeeded)

    - #### getScalePixelWidth

          public final float getScalePixelWidth()

    - #### setScalePixelWidth

          public final void setScalePixelWidth(float scalePixelWidth)

    - #### getTickStart

          public float getTickStart()

    - #### setTickStart

          public void setTickStart(float tickStart)

    - #### getScaleCalculator

          public ScaleCalculator getScaleCalculator()

    - #### setScaleCalculator

          public void setScaleCalculator(ScaleCalculator scaleCalculator)

    - #### computeAxisTitleDimensions

          public final void computeAxisTitleDimensions(String title,
                                                       ChartFont axisTitleFont)

      Parameters:
        `title` -
        `axisTitleFont` -

    - #### toHTML

          public void toHTML(HTMLGenerator htmlGenerator)

      Enables the testing routines to display the contents of this Object. Can only see 'private' fields from this class.
      Specified by:
        `toHTML` in interface `HTMLTestable`
      Parameters:
        `htmlGenerator` -

    - #### computeScalePixelWidth

          public void computeScalePixelWidth()

      Computes the number of pixels between each value on the axis.

    - #### computeScalePixelWidthDataAxis

          public void computeScalePixelWidthDataAxis()

      Computes the number of pixels between each value on the axis.

    - #### setOneUnitPixelSize

          public void setOneUnitPixelSize(double oneUnitPixelSize)

    - #### getOneUnitPixelSize

          public double getOneUnitPixelSize()

      Returns the number of pixels one value unit occupies.
      Returns:
        double the number of pixels one value unit occupies.

    - #### getZeroLineCoordinate

          public float getZeroLineCoordinate()

      Returns the screen coordinate of the zero line. This will not always be the same as the origin as not all charts start at zero. This is needed not only by the Axis, but some of the Chart implementations as well.
      Returns:
        float the screen pixel location of the zero line.

    - #### setZeroLineCoordinate

          public void setZeroLineCoordinate(float value)

      Sets the screen coordinate of the zero line. This will not always be the same as the origin as not all charts start at zero.
      Parameters:
        `value` - the screen pixel location of the zero line.

    - #### computeOneUnitPixelSize

          public void computeOneUnitPixelSize(float scalePixelLength,
                                              double increment)

      Computes the relationship of data point values to pixel values so know where along the axis a value is.
      Parameters:
        `scalePixelLength` -
        `increment` -