Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Axis3D

Three-dimensional Axis, that resides inside Chart3D. Can be either X, Y or Z. There is always exactly one Axis3D object for each dimension in a Chart3D.

Axes have automatic scrolling logic to fit attached Series. This can be modified with Axis.setScrollStrategy()

Axes are associated with a title, which can be enabled with Axis.setTitle()

Index

Methods

disableAnimations

  • disableAnimations(): this
  • Disable all animations for the Axis.

    After calling this function, animations (Zooming, scaling) will be disabled. Animations must be recreated manually afterwards.

    Returns this

    Axis itself for fluent interface.

fit

  • fit(animate?: number | boolean, freeze: boolean): this
  • Fit axis view to attached series.

    Parameters

    • animate: number | boolean

      Boolean for animation enabled, or number for animation duration in milliseconds

    • freeze: boolean

      Freeze axis to fitted view? False by default.

    Returns this

formatValue

  • formatValue(value: number): string
  • Format a value along axis to string. Behavior depends on the Axis' TickStrategy. Eq. A DateTime-Axis will interpret 'value' as a Date.

    Parameters

    • value: number

      Value along axis

    Returns string

    Value formated to string

getInterval

  • Get the currently applied axis scale interval.

    Returns AxisInterval

    Object containing the current start and end of Axis.

getScrollStrategy

  • getScrollStrategy(): AxisScrollStrategy | undefined
  • Returns AxisScrollStrategy | undefined

    Current AxisScrollStrategy

getStrokeStyle

  • getStrokeStyle(): LineStyle
  • Returns LineStyle

    Style of Axis line.

getTickStrategy

  • getTickStrategy(): TickStrategyType
  • Get the currently used tick strategy

    Returns TickStrategyType

getTitle

  • getTitle(): string
  • Returns string

    Axis title string

getTitleFillStyle

getTitleFont

  • Get font of axis labels.

    Returns FontSettings

    FontSettings

isStopped

  • isStopped(): boolean
  • Get is axes' scrolling currently prevented by usage of mouse-interactions or 'stop()' method.

    Returns boolean

    Boolean flag

offScaleChange

  • offScaleChange(token: Token): boolean
  • Remove subscription from scale change event

    Parameters

    • token: Token

      Event listener

    Returns boolean

    True if the listener is successfully removed and false if it is not found

onScaleChange

  • onScaleChange(listener: function): Token
  • Subscribe to on scale change event

    Parameters

    • listener: function

      Event listener

        • Parameters

          • start: number
          • end: number

          Returns void

    Returns Token

    Token that is used to unsubscribe from the event

Readonly release

  • release(): void
  • Undo effects of 'stop'.

    Returns void

setAnimationScroll

  • setAnimationScroll(enabled: boolean | undefined): this
  • Specifies scroll animation. Scroll animations can cause slow-downs with 3D charts with large amounts of data shown in the 3D chart.

    Parameters

    • enabled: boolean | undefined

      Boolean flag for whether scrolling should be animated or not.

    Returns this

setAnimationZoom

  • setAnimationZoom(easing: AnimationEasing | undefined, duration: number): this
  • Specifies zoom animation to use.

    Example usage:

    Desired result Argument Parameters
    Change animation setAnimationZoom(AnimationEasings.easeOut, 500) First parameter defines the easing to use for the animation. Second parameter is optional, and defines the duration for the animation
    Disable zooming animations axis.setAnimationZoom(undefined) Passing undefined as the parameter will disable the zooming animations for the Axis.

    Parameters

    • easing: AnimationEasing | undefined

      Easing of animation. Undefined disables zoom animations. See 'common/animator.Easings' for defaults

    • duration: number

      Optional default duration for zooming animations in milliseconds

    Returns this

setInterval

  • setInterval(start: number, end: number, animate: number | boolean | undefined, disableScrolling: boolean | undefined): this
  • Set axis scale interval.

    Parameters

    • start: number

      Start scale value

    • end: number

      End scale value

    • animate: number | boolean | undefined

      Boolean for animation enabled, or number for animation duration in milliseconds

    • disableScrolling: boolean | undefined

      If true, disables automatic scrolling after setting interval

    Returns this

    Object itself for fluent interface

setMouseInteractions

  • setMouseInteractions(enabled: boolean): this
  • Enable / disable all interactions of Axis.

    Parameters

    • enabled: boolean

      Interactions enabled or not.

    Returns this

    Object itself for fluent interface.

setScrollStrategy

  • setScrollStrategy(scrollStrategy?: AxisScrollStrategy): this
  • Specify ScrollStrategy of the Axis. This decides where the Axis scrolls based on current view and series boundaries.

    Parameters

    • scrollStrategy: AxisScrollStrategy

      AxisScrollStrategy or undefined to disable automatic scrolling. See AxisScrollStrategies for all options.

    Returns this

    Object itself for fluent interface.

setStrokeStyle

  • Set style of Axis line.

    Parameters

    • value: LineStyle | ImmutableMutator<LineStyle>

      A LineStyle object, or a function which modifies the current style.

    Returns this

    Object itself for fluent interface.

setTickStrategy

  • setTickStrategy(tickStrategy: TickStrategy, styler?: TickStrategyStyler<TickStrategyParameters, TickStrategy>): this
  • Set TickStrategy of Axis.

    The TickStrategy defines the positioning and formatting logic of Axis ticks as well as the style of created ticks.

    Example usage:

    DateTime Axis:

    Axis.setTickStrategy( AxisTickStrategies.DateTime )

    Disable automatic ticks completely:

    Axis.setTickStrategy( AxisTickStrategies.Empty )

    Customized TickStrategy:

    Axis.setTickStrategy( AxisTickStrategies.Numeric, ( tickStrategy: NumericTickStrategy ) => tickStrategy
        .setNumericUnits( true )
        .setMajorTickStyle( ( tickStyle ) => tickStyle
            .setLabelFont( ( font ) => font
                .setWeight( 'bold' )
            )
        )
    )

    Type table for optional second parameter ('styler'):

    tickStrategy styler
    'Numeric' ( tickStrategy: NumericTickStrategy ) => tickStrategy
    'DateTime' ( tickStrategy: DateTimeTickStrategy ) => tickStrategy
    'Empty' undefined

    Type parameters

    • TickStrategy: TickStrategyType

    Parameters

    • tickStrategy: TickStrategy

      Selected TickStrategy. See AxisTickStrategies for a collection of options.

    • styler: TickStrategyStyler<TickStrategyParameters, TickStrategy>

      Optional callback that can be used to customize the TickStrategy. The type of supplied TickStrategy object depends on what was supplied to 'tickStrategy' parameter; See the above method documentation for a value table.

    Returns this

    Object itself for fluent interface.

setTickStyle

  • setTickStyle(styler: TickStrategyStyler<TickStrategyParameters, TickStrategy>): this
  • Type parameters

    • TickStrategy: TickStrategyType

    Parameters

    • styler: TickStrategyStyler<TickStrategyParameters, TickStrategy>

    Returns this

setTitle

  • setTitle(title: string): this
  • Specifies an Axis title string

    Parameters

    • title: string

      Axis title as a string

    Returns this

    Axis itself for fluent interface

setTitleFillStyle

  • Specifies Axis title FillStyle

    Parameters

    Returns this

    Axis itself for fluent interface

setTitleFont

stop

  • stop(): this
  • Stop scrolling of axis until restored.

    Returns this