Options
All
  • Public
  • Public/Protected
  • All
Menu

Class VisibleTicks

Class which is used to style Axis Ticks. Use with Axis.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 })

Index

Constructors

constructor

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

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

    Parameters

    • props: Partial<TickStyleProperties>

      Optional object containing parameters for creation of VisibleTicks

    Returns VisibleTicks

Methods

getGridStrokeLength

  • getGridStrokeLength(): number
  • Get length of GridStroke.

    Returns number

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

getGridStrokeStyle

  • Get style of GridStrokes.

    Returns LineStyle

    LineStyle object

getLabelAlignment

  • getLabelAlignment(): number
  • Get horizontal alignment of Label respective to tick line.

    Returns number

    Horizontal alignment [-1, 1].

getLabelFillStyle

  • Get fill style of Label.

    Returns FillStyle

    Fill style of Label as a VisibleFill object

getLabelFont

  • Get font of Labels.

    Returns FontSettings

    FontSettings object

getLabelPadding

  • getLabelPadding(): pixel
  • Get padding after label as pixels.

    Returns pixel

    Padding after label as pixels.

getLabelRotation

  • getLabelRotation(): number
  • Get rotation of Label title.

    Returns number

    Rotation in degrees

getTickLength

  • getTickLength(): pixel
  • Get length of Ticks.

    Returns pixel

    Length of Ticks as pixels

getTickPadding

  • getTickPadding(): pixel
  • Get padding after Tick as pixels.

    Returns pixel

    Padding after Tick as pixels.

getTickStyle

  • Get style of Ticks.

    Returns LineStyle

    LineStyle object

setGridStrokeLength

  • setGridStrokeLength(length: number): this
  • Construct a new VisibleTicks object based on this one, but with modified gridstroke length.

    Parameters

    • length: number

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

    Returns this

    New VisibleTicks object

setGridStrokeStyle

  • 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)
    

    Parameters

    Returns this

    New VisibleTicks object

setLabelAlignment

  • setLabelAlignment(alignment: number): this
  • Set alignment of Label respective to tick line.

    after: -1

    center: 0

    before: +1

    Parameters

    • alignment: number

      Label alignment [-1, 1].

    Returns this

    New VisibleTicks object with modified Label alignment

setLabelFillStyle

  • 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)
    

    Parameters

    Returns this

    New VisibleTicks object

setLabelFont

  • Construct a new VisibleTicks object based on this one, but with modified Label font.

    Example usage:

    // Specified FontSettings
    VisibleTicks.setLabelFont(new FontSettings({ size: 24, style: 'italic' }))
    // Set to bold
    VisibleTicks.setLabelFont((fontSettings) => fontSettings.setWeight('bold'))
    

    Parameters

    Returns this

    New VisibleTicks object

setLabelPadding

  • setLabelPadding(padding: pixel): this
  • Set padding after label as pixels.

    Parameters

    • padding: pixel

      Padding after label as pixels.

    Returns this

    New VisibleTicks object with modified Label padding

setLabelRotation

  • setLabelRotation(rotation: number): this
  • Set rotation of Label title.

    Parameters

    • rotation: number

    Returns this

    Object itself

setTickLength

  • setTickLength(length: pixel): this
  • Set length of Ticks.

    Parameters

    • length: pixel

      Length of Ticks as pixels.

    Returns this

    New VisibleTicks object

setTickPadding

  • setTickPadding(padding: pixel): this
  • Set padding after Tick as pixels.

    Parameters

    • padding: pixel

      Padding after Tick as pixels.

    Returns this

    New VisibleTicks object with modified Tick padding

setTickStyle

  • 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)
    

    Parameters

    Returns this

    New VisibleTicks object

Static Record

  • Record(defaultValues: TProps, name?: undefined | string): Factory<TProps>
  • Unlike other types in Immutable.js, the Record() function creates a new Record Factory, which is a function that creates Record instances.

    See above for examples of using Record().

    Note: Record is a factory function and not a class, and does not use the new keyword during construction.

    Type parameters

    • TProps

    Parameters

    • defaultValues: TProps
    • name: undefined | string

    Returns Factory<TProps>