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

Hierarchy

Methods

  • Fit axis view to attached series.

    Parameters

    • Optional animate: number | boolean

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

    • stopAxisAfter: boolean = false

      If true, stops Axis after fitting

    Returns Axis3D

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

    Returns

    Value formated to string

    Parameters

    • value: number

      Value along axis

    Returns string

  • Get animations disable/enable state.

    Returns

    Animations default state.

    Returns boolean

  • Get Axis stopped or not.

    When an Axis is stopped it temporarily prevents the active scroll strategy from changing the Axis interval.

    Axis can be stopped programmatically using this method, and also by different built in interactions, such as panning/zooming.

    Returns

    Axis stopped

    Returns boolean

  • Get the currently used tick strategy

    Returns "Empty" | "Numeric" | "DateTime" | "Time"

  • Returns

    Axis title string

    Returns string

  • Get theme effect enabled on component or disabled.

    A theme can specify an Effect to add extra visual oomph to chart applications, like Glow effects around data or other components. Whether this effect is drawn above a particular component can be configured using the setEffect method.

     // Example, disable theme effect from a particular component.
    Component.setEffect(false)

    For the most part, theme effects are enabled by default on most components.

    Theme effect is configured with effect property.

    Returns

    Boolean that describes whether drawing the theme effect is enabled around the component or not.

    Returns boolean

  • Get rotation of Axis title.

    Returns

    Rotation in degrees

    Returns number

  • Get element visibility.

    Returns

    true when element is set to be visible and false otherwise.

    Returns boolean

  • Remove subscription from scale change event

    Returns

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

    Parameters

    • token: Token

      Event listener

    Returns boolean

  • Remove event listener from event when Axis is stopped or released.

    This event is triggered when Axis.setStopped method is used (and state actually changes), or the Axis is stopped/released by a built-in user interaction.

     // Example, attach and remove event handler.
    const token = Axis.onStoppedStateChanged((_, isStopped) => {})

    Axis.offStoppedStateChanged(token)

    Parameters

    • token: Token

    Returns boolean

  • Remove event listener from visibleStateChanged

    Parameters

    • token: Token

    Returns boolean

  • Subscribe to on scale change event

    The onIntervalChange event triggers on change of the interval of an Axis and accept a callback function with 3 parameters that return axis itself, start and end values of the Axis

    Example usage:

    Axis.onIntervalChange((axis, start, end) => {
    console.log(`start value: ${start}, end value : ${end}`);
    }
    )

    Returns

    Token that is used to unsubscribe from the event

    Parameters

    • listener: ((axis: Axis3D, start: number, end: number) => void)

      Event listener

        • (axis: Axis3D, start: number, end: number): void
        • Parameters

          • axis: Axis3D
          • start: number
          • end: number

          Returns void

    Returns Token

  • Register new event listener to event when Axis is stopped or released.

    This event is triggered when Axis.setStopped method is used (and state actually changes), or the Axis is stopped/released by a built-in user interaction.

     // Example, track when Axis is stopped or released.
    const token = Axis.onStoppedStateChanged((_, isStopped) => {
    console.log({isStopped})
    })

    Returns

    Token of event subscription which can be used to remove the event listener using offStoppedStateChanged method.

    Parameters

    • listener: ((obj: Axis3D, isStopped: boolean) => unknown)

      Event listener that is called when the event triggers.

        • (obj: Axis3D, isStopped: boolean): unknown
        • Parameters

          • obj: Axis3D
          • isStopped: boolean

          Returns unknown

    Returns Token

  • Register new event listener to visibleStateChanged event.

    Parameters

    • listener: VisibleStateChangedHandler<Axis3D>

      Event listener for visibleStateChanged

    Returns Token

  • Specifies scroll animation.

    Parameters

    • enabled: undefined | boolean

      Boolean flag for whether scrolling should be animated or not.

    Returns Axis3D

  • 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: undefined | AnimationEasing

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

    • duration: number = 300

      Optional default duration for zooming animations in milliseconds

    Returns Axis3D

  • Disable/Enable all animations of the Chart.

    Returns

    Axis itself for fluent interface.

    Parameters

    • animationsEnabled: boolean

      Boolean value to enable/disable animations.

    Returns Axis3D

  • Set axis interval.

    Examples:

     // Set interval start and end.
    Axis.setInterval({ start: 0, end: 5000 })
     // Set interval end only.
    Axis.setInterval({ end: 5000 })
     // Set interval but don't stop the axis from scrolling
    Axis.setInterval({ start: 0, end: 5000, stopAxisAfter: false })
     // Set interval with 2000 milliseconds long animation
    Axis.setInterval({ start: 0, end: 5000, animate: 2000 })

    Returns

    Object itself for fluent interface

    Parameters

    • opts: AxisIntervalConfiguration

      Parameters for axis interval.

    Returns Axis3D

  • Enable / disable all interactions of Axis.

    Returns

    Object itself for fluent interface.

    Parameters

    • enabled: boolean

      Interactions enabled or not.

    Returns Axis3D

  • Set Axis stopped or not.

    When an Axis is stopped it temporarily prevents the active scroll strategy from changing the Axis interval.

    Axis can be stopped programmatically using this method, and also by different built in interactions, such as panning/zooming.

     // Example, stop Axis scrolling / fitting.
    Axis.setStopped(true)

    Returns

    Object itself

    Parameters

    • stopped: boolean

      Axis stopped

    Returns Axis3D

  • Set style of Axis line stroke.

     // Example syntax, specify LineStyle
    Axis.setStrokeStyle(new SolidLine({
    thickness: 2,
    fillStyle: new SolidFill({ color: ColorHEX('#F00') })
    }))
     // Example syntax, change thickness only
    Axis.setStrokeStyle((stroke) => new SolidLine({ ...stroke, thickness: 5 }))

    Supported fill styles:

    SolidFill:

    Solid fill color.

     // Example, solid colored line.
    Axis.setStrokeStyle(new SolidLine({
    thickness: 2,
    fillStyle: new SolidFill({ color: ColorRGBA(255, 0, 0) })
    }))

    To learn more about available Color factories, see ColorRGBA

    PalettedFill:

    Color line stroke dynamically based on x, y or z coordinate.

     // Example, dynamic color by Y coordinates
    Axis.setStrokeStyle(new SolidLine({
    thickness: 2,
    fillStyle: new PalettedFill({
    lookUpProperty: 'y',
    lut: new LUT({
    interpolate: true,
    steps: [
    { value: 0, color: ColorRGBA(255, 0, 0) },
    { value: 10, color: ColorRGBA(0, 255, 0) },
    ]
    })
    })
    }))

    To learn more about Color lookup tables, see LUT.

    LinearGradientFill:

    Color line stroke with a linear configurable gradient palette.

     // Example, linear gradient line color
    Axis.setStrokeStyle(new SolidLine({
    thickness: 2,
    fillStyle: new LinearGradientFill()
    }))

    To learn more about linear gradient configurations, see LinearGradientFill.

    RadialGradientFill:

    Color line stroke with a radial configurable gradient palette.

     // Example, radial gradient line color
    Axis.setStrokeStyle(new SolidLine({
    thickness: 2,
    fillStyle: new RadialGradientFill()
    }))

    To learn more about radial gradient configurations, see RadialGradientFill.

    Returns

    Object itself for fluent interface.

    Parameters

    Returns Axis3D

  • Specifies an Axis title string

    Returns

    Axis itself for fluent interface

    Parameters

    • title: string

      Axis title as a string

    Returns Axis3D

  • Set theme effect enabled on component or disabled.

    A theme can specify an Effect to add extra visual oomph to chart applications, like Glow effects around data or other components. Whether this effect is drawn above a particular component can be configured using the setEffect method.

     // Example, disable theme effect from a particular component.
    Component.setEffect(false)

    For the most part, theme effects are enabled by default on most components.

    Theme effect is configured with effect property.

    Returns

    Object itself.

    Parameters

    • enabled: boolean

      Theme effect enabled

    Returns Axis3D

  • Set element visibility.

    Returns

    Object itself.

    Parameters

    • state: boolean

      true when element should be visible and false when element should be hidden.

    Returns Axis3D