Class which is used to style Axis Ticks. Use with setTickStyle

Instances of VisibleTicks are immutable, meaning that its setters don't modify the object, but instead return a completely new modified object.

When creating a new VisibleTicks object from scratch, parameters can be passed like follows:

  • new VisibleTicks({ labelFillStyle: new SolidFill({ color: ColorHEX('#F00'), tickLength: 8 })

Hierarchy

Properties

gridStrokeLength: number

Length of GridStroke, where 1 = full and 0 = zero.

gridStrokeStyle: LineStyle

Style of GridStroke as a SolidLine object.

labelAlignment: number

Horizontal alignment of Label respective to tick line.

left: -1

center: 0

right: +1

labelFillStyle: FillStyle

FillStyle of Label.

labelFont: FontSettings

Font of Label as FontSettings.

labelPadding: number

Padding after label as pixels.

labelRotation: number

Label rotation in degrees.

tickLength: number

Length of Tick itself as pixels.

tickPadding: number

Padding after Tick as pixels.

tickStyle: LineStyle

Style of Tick itself as a SolidLine object.

Methods

  • Get length of GridStroke.

    Returns

    Length of GridStroke, where 1 = full and 0 = zero.

    Returns number

  • Get style of GridStrokes.

    Returns

    LineStyle object

    Returns LineStyle

  • Get horizontal alignment of Label respective to tick line.

    Returns

    Horizontal alignment [-1, 1].

    Returns number

  • Get fill style of Label.

    Returns

    Fill style of Label as a VisibleFill object

    Returns FillStyle

  • Get padding after label as pixels.

    Returns

    Padding after label as pixels.

    Returns number

  • Get rotation of Label title.

    Returns

    Rotation in degrees

    Returns number

  • Get length of Ticks.

    Returns

    Length of Ticks as pixels

    Returns number

  • Get padding after Tick as pixels.

    Returns

    Padding after Tick as pixels.

    Returns number

  • Construct a new VisibleTicks object based on this one, but with modified gridstroke length.

    Returns

    New VisibleTicks object

    Parameters

    • length: number

      Length of GridStroke, where 1 = full and 0 = zero.

    Returns VisibleTicks

  • Construct a new VisibleTicks object based on this one, but with modified GridStroke style.

    Example usage:

    // Specified SolidLine
    VisibleTicks.setGridStrokeStyle(new SolidLine({ thickness: 2, fillStyle: new SolidFill({ color: ColorHEX('#F00') }) }))
    // Changed thickness
    VisibleTicks.setGridStrokeStyle((solidLine) => solidLine.setThickness(5))
    // Hidden
    VisibleTicks.setGridStrokeStyle(emptyLine)

    Returns

    New VisibleTicks object

    Parameters

    Returns VisibleTicks

  • Set alignment of Label respective to tick line.

    after: -1

    center: 0

    before: +1

    Returns

    New VisibleTicks object with modified Label alignment

    Parameters

    • alignment: number

      Label alignment [-1, 1].

    Returns VisibleTicks

  • Set fill style of Labels.

    Example usage:

    // Specified FillStyle
    VisibleTicks.setLabelFillStyle(new SolidFill({ color: ColorHEX('#F00') }))
    // Changed transparency
    VisibleTicks.setLabelFillStyle((solidFill) => solidFill.setA(80))
    // Hidden
    VisibleTicks.setLabelFillStyle(emptyFill)

    Returns

    New VisibleTicks object

    Parameters

    Returns VisibleTicks

  • Set padding after label as pixels.

    Returns

    New VisibleTicks object with modified Label padding

    Parameters

    • padding: number

      Padding after label as pixels.

    Returns VisibleTicks

  • Set rotation of Label title.

    Returns

    Object itself

    Parameters

    • rotation: number

    Returns VisibleTicks

  • Set length of Ticks.

    Returns

    New VisibleTicks object

    Parameters

    • length: number

      Length of Ticks as pixels.

    Returns VisibleTicks

  • Set padding after Tick as pixels.

    Returns

    New VisibleTicks object with modified Tick padding

    Parameters

    • padding: number

      Padding after Tick as pixels.

    Returns VisibleTicks

  • Construct a new VisibleTicks object based on this one, but with modified Tick style.

    Example usage:

    // Specified SolidLine
    VisibleTicks.setGridStrokeStyle(new SolidLine({ thickness: 2, fillStyle: new SolidFill({ color: ColorHEX('#F00') }) }))
    // Changed thickness
    VisibleTicks.setGridStrokeStyle((solidLine) => solidLine.setThickness(5))
    // Hidden
    VisibleTicks.setGridStrokeStyle(emptyLine)

    Returns

    New VisibleTicks object

    Returns VisibleTicks