com.orsoncharts.axis

## Class TickData

- java.lang.Object
- - com.orsoncharts.axis.TickData

-     public class TickData
      extends java.lang.Object

  Data related to the tick marks and labels on a chart.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TickData(double pos, java.lang.Comparable<?> key, java.lang.String keyLabel)` Creates a new instance.
    `TickData(double pos, double dataValue)` Creates a new instance.
    `TickData(TickData source, int vertexIndex)` Creates a new instance by copying an existing instance but altering the vertex index.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.awt.geom.Point2D` | `getAnchorPt()` Returns the anchor point.
    `double` | `getDataValue()` Returns the data value when the tick data is for a `NumberAxis3D`, and `Double.NaN` otherwise.
    `java.lang.Comparable<?>` | `getKey()` Returns the key when the tick data is for a `CategoryAxis3D`, and `null` otherwise.
    `java.lang.String` | `getKeyLabel()` Returns the key label.
    `double` | `getPos()` Returns the position of the tick, as a percentage along the axis (for example, 0.5 is halfway along the axis).
    `int` | `getVertexIndex()` Returns the vertex index that is the anchor point for the tick mark.
    `void` | `setAnchorPt(java.awt.geom.Point2D anchorPt)` Sets the anchor point.
    `void` | `setVertexIndex(int index)` Sets the vertex index.

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

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

- - ### Constructor Detail

    - #### TickData

          public TickData(double pos,
                          java.lang.Comparable<?> key,
                          java.lang.String keyLabel)

      Creates a new instance. This constructor is used for category axes.
      Parameters:
        `pos` - the position along the axis as a percentage of the range.
        `key` - the key.
        `keyLabel` - the key label.

    - #### TickData

          public TickData(double pos,
                          double dataValue)

      Creates a new instance. This constructor is used for numerical axes.
      Parameters:
        `pos` - the position along the axis as a percentage of the range.
        `dataValue` - the data value.

    - #### TickData

          public TickData(TickData source,
                          int vertexIndex)

      Creates a new instance by copying an existing instance but altering the vertex index.
      Parameters:
        `source` - a source to copy (`null` not permitted).
        `vertexIndex` - the vertex index.

  - ### Method Detail

    - #### getPos

          public double getPos()

      Returns the position of the tick, as a percentage along the axis (for example, 0.5 is halfway along the axis).
      Returns:
        The position.

    - #### getKey

          public java.lang.Comparable<?> getKey()

      Returns the key when the tick data is for a `CategoryAxis3D`, and `null` otherwise.
      Returns:
        The key (possibly `null`).

    - #### getKeyLabel

          public java.lang.String getKeyLabel()

      Returns the key label.
      Returns:
        The key label (possibly `null`).
      Since:
        1.2

    - #### getDataValue

          public double getDataValue()

      Returns the data value when the tick data is for a `NumberAxis3D`, and `Double.NaN` otherwise.
      Returns:
        The data value.

    - #### getVertexIndex

          public int getVertexIndex()

      Returns the vertex index that is the anchor point for the tick mark.
      Returns:
        The vertex index.

    - #### setVertexIndex

          public void setVertexIndex(int index)

      Sets the vertex index. The vertex is a point in 3D space that is the anchor point for the tick mark, after this is projected to 2D space we have a reference point for the tick mark.
      Parameters:
        `index` - the index.

    - #### getAnchorPt

          public java.awt.geom.Point2D getAnchorPt()

      Returns the anchor point.
      Returns:
        The anchor point.

    - #### setAnchorPt

          public void setAnchorPt(java.awt.geom.Point2D anchorPt)

      Sets the anchor point. This is the projected point in 2D space of the vertex we track in 3D space.
      Parameters:
        `anchorPt` - the anchor point.