Axis is a child component of ChartXY. It defines a numeric range on a single plane (X or Y), that will be used to scale attached Series to the ChartXYs viewport.

The default Axis can be referenced with getDefaultAxisX and getDefaultAxisY.

ChartXY doesn't have a limit on number of axes. Additional axes can be created with addAxisX and addAxisY. Multiple Axes can be stacked on top of another, and axes can be positioned on either side of the chart (left, right, top, bottom, see AxisOptions).

The visual components of axis are:

See Scrolling and interval configuration for detailed information about management of axis interval.

Axis Ticks

Ticks are labels attached to the axis line that visualize the progression of values along the axis. A tick consists of three individually stylable parts:

  • Label (text)
  • Tick line.
  • Grid line.

There are currently three different ways of managing axis ticks:

  1. Automatic numeric ticks (default).
  2. Automatic time ticks.
  3. Automatic datetime ticks.
  4. Custom ticks.
Numeric ticks

Numeric ticks are enabled by default for all axes. They are designed for depicting numeric values of all magnitudes.

Configuring the ticks is done with setTickStrategy.

Axis.setTickStrategy(AxisTickStrategies.Numeric, (strategy) => strategy
// Configure NumericTickStrategy
.setMinorFormattingFunction((tickPosition) => `X: ${tickPosition}`)
.setMinorTickStyle((tickStyle: TickStyle) => tickStyle
.setTickLength(12)
.setTickPadding(2)
)
)

Frequently used API:

For full list of configuration API, see NumericTickStrategy.

Examples showcasing numeric axes:

Time ticks

Time ticks are designed for depicting time ranges between hundreds of hours to individual nanoseconds.

They are enabled, as well as configured, with setTickStrategy.

Axis.setTickStrategy(AxisTickStrategies.Time, (strategy) => strategy
// Configure TimeTickStrategy
.setMinorFormattingFunction((tickPosition) => `X: ${tickPosition}`)
.setMinorTickStyle((tickStyle: TickStyle) => tickStyle
.setTickLength(12)
.setTickPadding(2)
)
)

Frequently used API:

For full list of configuration API, see TimeTickStrategy.

Examples showcasing TimeTickStrategy:

  • No listed examples as of yet.
Datetime ticks

DateTime ticks are enabled, as well as configured, with setTickStrategy.

Axis.setTickStrategy(AxisTickStrategies.DateTime, (strategy) => strategy
// Configure DateTimeTickStrategy
.setMinorTickStyle((tickStyle: TickStyle) => tickStyle
.setTickLength(12)
.setTickPadding(2)
)
)

Frequently used API:

For full list of configuration API, see DateTimeTickStrategy.

Examples showcasing datetime axes:

Custom ticks

Automatic creation of ticks can be disabled with setTickStrategy:

// Disable automatic axis ticks.
Axis.setTickStrategy(AxisTickStrategies.Empty)

Custom ticks can be created with addCustomTick:

// Create custom ticks.
for (let x = 0; x < 100; x += 10) {
const tick = Axis.addCustomTick(UIElementBuilders.AxisTickMajor)
}

Frequently used CustomTick API:

Examples showcasing custom axis ticks:

Axis automatic scrolling and Axis intervals configuration

Axis interval is the range of data values that are visible on the Axis, they are referred to as start and end.

By default, all axes fit the interval automatically to reveal all attached series. This behavior is called fitting scroll strategy.

Automatic scrolling behavior can be controlled by selecting the scroll strategy, with setScrollStrategy:

// Select progressive scroll strategy.
Axis.setScrollStrategy(AxisScrollStrategies.progressive)

Following scroll strategies are supported:

Axis interval can be manually set with setInterval:

// Axis start = 0, end = 100.
Axis.setInterval({ start: 0, end: 100 })

Setting Axis interval stops axis scrolling by default. To specify axis interval and keep auto scrolling enabled, use the optional stopAxisAfter parameter:

Axis.setInterval({ start: 0, end: 100, stopAxisAfter: false })

Frequently used methods:

  • setScrollStrategy | configure automatic scrolling behavior.
  • setInterval | configure active axis interval.
  • getInterval | get active axis interval.
  • fit | fit axis interval to contain all attached series boundaries.
  • Axis.stop | stop automatic scrolling momentarily.
  • Axis.onIntervalChange | trigger a custom action whenever axis scale changes.
  • setAnimationScroll | Enable/disable automatic scrolling animation.
Axis interval limitations

LightningChart JS is easily the market leader in zooming interactions and visualization resolution, and contrary to most chart libraries, we are open about axis zooming limits;

"Axis zooming limits" refer to constraints on the magnitude of Axis interval, which is calculated as Math.abs(end - start). When the limit is reached, the Axis will not be able to zoom in and out further by programmatic calls (setInterval) or user interactions.

The constraints are primarily affected by two factors:

  • Active Tick Strategy.
  • Axis type.

Both of these factors have their own definition of support minimum and maximum Axis interval, and when combined the lesser values are used. For example, if Tick Strategy would allow min interval of 0.001 and Axis type 0.005, effectively the min interval would be 0.001.

The Axis interval limits imposed by each available Tick Strategy are documented at AxisTickStrategies.

The Axis interval limits imposed by Axis Type are documented at AxisOptions.

Axis highlighters

Two kinds of highlighters are supported:

  • ConstantLine | highlights a position on the Axis.
  • Band | highlights a range on the Axis.

Examples showcasing axis highlighters:

Hierarchy

Implements

Properties

isX: boolean
isY: boolean
title: Eventer<LCJSInteractionEventMap, any> = ...

Interface for attaching listeners to user interaction events (click, pointerenter, etc.) on axis title.

 // Example syntax
axis.title.addEventListener('click', (event) => {
console.log(event)
})

For syntax examples, refer to EventInterface. Available event keys are listed under LCJSInteractionEventMap

Accessors

  • get draggable(): boolean
  • Returns boolean

  • set draggable(state: boolean): void
  • Parameters

    • state: boolean

    Returns void

Methods

  • Used in phase 1: after we know what ticks will be displayed, formulate generic information for chart layout calculations (e.g. XY layout for XY charts).

    Parameters

    • input: _UpdateInputAxisXY
    • ticksInfo: Map<Tick, _TickXYInfo>

    Returns _UpdateOutputAxisXY

  • Add a highlighter Band to the Axis. A Band can be used to highlight an interval on the Axis.

    Returns

    Band object.

    Parameters

    • onTop: boolean = true

      Is Band rendered above Series, or below. Default to above.

    Returns Band

  • Add a highlighter ConstantLine to the Axis. A ConstantLine can be used to highlight a specific value on the Axis.

    Returns

    ConstantLine object.

    Parameters

    • onTop: boolean = true

      Is ConstantLine rendered above Series, or below. Default to above.

    Returns ConstantLine

  • Add custom tick to Axis. Custom ticks can be used to expand on default tick placement, or completely override Axis ticks placement with custom logic.

    Example usage:

    Create custom tick, specify position on Axis and label text.

     const customTick = Axis.addCustomTick(UIElementBuilders.PointableTextBox)
    .setValue(5)
    // Label text is specified with a callback function.
    // This example formats Axis positions with one fraction, like this: "5.0"
    .setTextFormatter((value) => value.toFixed(1))

    Select CustomTick Marker type.

     // CustomTick shape can be changed by supplying a tick marker builder.
    // The supported values are 'AxisTickMajor', 'AxisTickMinor' and 'PointableTextBox'
    const customTick1 = Axis.addCustomTick(UIElementBuilders.AxisTickMajor)
    const customTick2 = Axis.addCustomTick(UIElementBuilders.AxisTickMinor)
    const customTick3 = Axis.addCustomTick(UIElementBuilders.PointableTextBox)

    Disable default ticks, and create custom positioned ticks.

     // Disable default Axis ticks.
    Axis.setTickStrategy(AxisTickStrategies.Empty)

    // Create a bunch of custom positioned ticks.
    for (let x = 0; x <= 100; x += 10) {
    Axis.addCustomTick()
    .setValue(x)
    }

    For more information, like styling custom ticks, see CustomTick.

    Returns

    CustomTick.

    Parameters

    Returns CustomTick

  • Add callback function to be triggered when specified event is fired.

     // Example syntax
    object.addEventListener('click', (event) => {
    console.log(event)
    })

    Some classes also report extra information about the interacted object with the second parameter:

     // Most series share information about interacted data point
    series.addEventListener('click', (event, info) => {
    console.log(info)
    })

    Optional third parameter allows registering event handlers that will automatically remove themselves after first trigger:

     // Example this listener will only fire once
    object.addEventListener('click', (event) => {})

    Each class has its own list of supported events. Some events are from HTML standard (click, pointerdown, etc.), while others are own events from LightningChart JS (dispose, resize, etc.)

    To find what events are available, you can try following:

    • If your development environment has TypeScript enabled, just write addEventListener and see what possible event types the IDE suggests. These APIs are strongly typed, and even the callback event will be correctly typed.
    • Otherwise, open the class section in API documentation and check out which interface K type parameter extends.

    Type Parameters

    Parameters

    • type: K
    • listener: ((event: AxisEventMap[K], info: unknown) => unknown)

      Callback function that is triggered when event is fired.

    • Optional options: LCJSAddEventListenerOptions

      Optional extra configuration options.

    Returns void

  • Permanently destroy the component.

    To fully allow Garbage-Collection to free the resources used by the component, make sure to remove any references to the component and its children in application code.

    let chart = ...ChartXY()
    let axisX = chart.getDefaultAxisX()
    // Dispose Chart, and remove all references so that they can be garbage-collected.
    chart.dispose()
    chart = undefined
    axisX = undefined

    Returns

    Object itself for fluent interface

    Returns Axis

  • Fit axis view to attached series.

    Parameters

    • Optional animate: number | boolean

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

    • Optional stopAxisAfter: boolean

      If true, stops Axis after fitting

    Returns Axis

  • 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 component highlight animations enabled or not.

    Returns

    Animation enabled?

    Returns boolean

  • Get animations disable/enable state.

    Returns

    Animations default state.

    Returns boolean

  • Get state of component highlighting.

    Returns

    Number between 0 and 1, where 1 is fully highlighted.

    Returns number

  • Get boolean flag for whether object should highlight on mouse hover

    Returns

    Boolean for if object should highlight on mouse hover or not.

    Returns boolean

  • Get all Highlighters of Axis.

    Returns

    array of highlighters

    Returns Highlighter[]

  • Get current value of setIntervalRestrictions. By default, no restrictions.

    Returns undefined | {
        endMax?: number;
        endMin?: number;
        intervalMax?: number;
        intervalMin?: number;
        startMax?: number;
        startMin?: number;
    }

  • Check whether axis should keep axis tick labels in its boundaries. This is done by shifting the label so that it fits (doesn't go outside axis bounds). This effect can cause labels to overlap with each other, but generally it does not occur in normal scenarios. This is enabled by default.

    Returns

    Boolean

    Returns boolean

  • Beta

    Get relative size of axis in its own "Stack".

    For example, if you have a chart with 2 stacked Y axes, by default they will have equal heights. By altering axis relative size, you can adjust how the chart height is distributed between these two axes.

    Defaults always to 1.

    Released in v5.2. API may be changed according to user feedback and comments.
    

    Returns {
        pixels: number;
    } | {
        relative: number;
    }

  • Returns

    Padding after axis ticks.

    Returns number

  • Returns

    Padding after Axis title

    Returns number

  • Beta

    Get axis margins as set with setMargins.

    Released in v5.2. API may be changed according to user feedback and comments.
    

    Returns {
        end: number;
        start: number;
    }

    • end: number
    • start: number
  • Get style of axis overlay (shown only when interacting with mouse / touch).

    Returns

    FillStyle object

    Returns FillStyle

  • Beta

    Get index of Axis in its own "Parallel". This simply retrieves same value which was used (or defaulted) when axis was created. See iParallel.

    Released in v5.2. API may be changed according to user feedback and comments.
    

    Returns number

  • Get whether element can be target of pointer events or not.

    Returns

    Pointer events state

    Returns boolean

  • Beta

    Get index of Axis in its own "Stack". This simply retrieves same value which was used (or defaulted) when axis was created. See iStack.

    Released in v5.2. API may be changed according to user feedback and comments.
    

    Returns number

  • 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 Axis thickness min/max limits as pixels.

    For X Axis, this means Axis height.

    For Y Axis, this means Axis width.

    By default, Axis has no thickness restrictions, so getThickness should return { min: undefined, max: undefined }.

    Returns

    Actively configured Axis thickness limits as pixels.

    Returns {
        max: undefined | number;
        min: undefined | number;
    }

    • max: undefined | number
    • min: undefined | number
  • 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 axis title position.

    Returns

    AxisXYTitlePosition

    Returns "center" | "end" | "start"

  • Get rotation of Axis title.

    Returns

    Rotation in degrees

    Returns number

  • Get position of axis on its chart as a %

    Returns number

  • Beta

    Get unit that Axis measures. e.g. "Hz", or "°C".

    • The unit is displayed after the Axis title (if it is defined). e.g. "Axis title (Hz)"

    • Default cursor formatters place the Unit next to units of the Axis.

                Introduced in LightningChart JS v6.0.0. Behavior or API might change in following versions depending on user feedback.
      

    Returns undefined | string

  • Get element visibility.

    Returns

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

    Returns boolean

  • Pan scale by pixel value delta.

    Used by ChartXY as well as Axis itself.

    Parameters

    • amount: number

      Amount to shift scale of axis in pixels

    • Optional opts: {
          releaseScrollingAxisIfLiveReached?: boolean;
      }
      • Optional releaseScrollingAxisIfLiveReached?: boolean

    Returns void

  • Remove event listener added using addEventListener. The expected argument should be the exact same callback function that was supplied using addEventListener:

     // Basic example syntax
    const listener = () => {}
    obj.addEventListener('click', listener)
    obj.removeEventListener('click', listener)
     // Basic boilerplate of custom interaction when user drags on an object
    obj.addEventListener('pointerdown', (eventDown) => {
    let prevCoord = eventDown
    const handlePointerMove: LCJSInteractionEventListener<'pointermove'> = (eventMove) => {
    const delta = { x: eventMove.clientX - prevCoord.clientX, y: eventMove.clientY - prevCoord.clientY }
    prevCoord = eventMove
    console.log(delta, eventMove.clientX, eventMove.clientY)
    }
    const handlePointerUp: LCJSInteractionEventListener<'pointerup'> = (eventUp) => {
    window.removeEventListener('pointermove', handlePointerMove)
    window.removeEventListener('pointerup', handlePointerUp)
    }
    window.addEventListener('pointermove', handlePointerMove)
    window.addEventListener('pointerup', handlePointerUp)
    })

    Type Parameters

    Parameters

    • type: K
    • listener: ((event: AxisEventMap[K], info: unknown) => unknown)

      Listener that was added using addEventListener.

    Returns void

  • Set component highlight animations enabled or not. For most components this is enabled by default.

     // Example usage, disable highlight animations.
    component.setAnimationHighlight(false)

    Returns

    Object itself

    Parameters

    • enabled: boolean

      Animation enabled?

    Returns Axis

  • Specifies scroll animation.

    Parameters

    • enabled: undefined | boolean

      Boolean flag for whether scrolling should be animated or not.

    Returns Axis

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

  • Disable/Enable all animations of the Chart.

    Returns

    Axis itself for fluent interface.

    Parameters

    • animationsEnabled: boolean

      Boolean value to enable/disable animations.

    Returns Axis

  • Beta

    Method that allows disabling Axis allocating automatic pixel based regions around data start and data end. For example, if Axis has attached point series with 10px size, the Axis can automatically add 10px gaps at both start and end.

    This behavior is enabled normally, but in some cases it can cause problems with several axes being out of sync, in which case they can be disabled with this method.

    Returns

    Object itself.

    Introduced in v5.2.0. Method may be removed/changed depending on how the related use cases evolve.

    Parameters

    • enabled: boolean

      Auto regions enabled or not.

    Returns Axis

  • Set Axis default interval. This does the same as setInterval method, but is also applied again whenever fit is triggered, or the "zoom to fit" user interaction is triggered.

    Intended to be used in use cases that set an Axis interval nicely at start of application.

     // Example 1, set hardcoded interval at application start
    Axis.setDefaultInterval({ start: 0, end: 100 })

    This method also allows interval specification as a callback function, allowing the applied default interval to be based on the range of data or current axis interval:

     // Example 2, scrolling axis - when axis is fitted, restore default time window and continue scrolling
    Axis.setDefaultInterval((state) => ({
    end: state.dataMax ?? 0,
    start: (state.dataMax ?? 0) - 10_000,
    stopAxisAfter: false,
    }))
     // Example 3, add some extra space
    Axis.setDefaultInterval((state) => ({
    start: (state.dataMin ?? 0) - 10,
    end: (state.dataMax ?? 0) + 10,
    }))

    Parameters

    • arg: undefined | AxisIntervalConfiguration | ((state: {
          curEnd: number;
          curStart: number;
          dataMax: undefined | number;
          dataMin: undefined | number;
      }) => AxisIntervalConfiguration)
    • Optional opts: {
          applyImmediately: boolean;
      }
      • applyImmediately: boolean

    Returns Axis

  • Set state of component highlighting.

     // Example usage

    component.setHighlight(true)

    Returns

    Object itself

    Parameters

    • highlight: number | boolean

      Boolean or number between 0 and 1, where 1 is fully highlighted.

    Returns Axis

  • Set highlight on mouse hover enabled or disabled.

    Mouse interactions have to be enabled on the component for this to function as expected. See setPointerEvents for more information.

    Returns

    Object itself for fluent interface.

    Parameters

    • state: boolean

      True if highlighting on mouse hover, false if no highlight on mouse hover

    Returns Axis

  • 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

    Returns Axis

  • Set restrictions on Axis interval (start/end). These are not applied immediately, but affect all axis scrolling and user interactions afterwards.

     // Example 1, prevent zooming outside active data set
    Axis.setIntervalRestrictions((state) => ({
    startMin: state.dataMin,
    endMax: state.dataMax,
    }))
     // Example 2, set max zoom in level (intervalMin)
    Axis.setIntervalRestrictions({ intervalMin: 10 })
     // Example 3, set max zoom out level (intervalMax)
    Axis.setIntervalRestrictions({ intervalMax: 1000 })
     // Example 4, no restrictions
    Axis.setIntervalRestrictions(undefined)

    Parameters

    • arg: undefined | {
          endMax?: number;
          endMin?: number;
          intervalMax?: number;
          intervalMin?: number;
          startMax?: number;
          startMin?: number;
      } | ((state: {
          curEnd: number;
          curStart: number;
          dataMax: undefined | number;
          dataMin: undefined | number;
      }) => {
          endMax?: number;
          endMin?: number;
          intervalMax?: number;
          intervalMin?: number;
          startMax?: number;
          startMin?: number;
      })

    Returns Axis

  • Configure whether axis should keep axis tick labels in its boundaries. This is done by shifting the label so that it fits (doesn't go outside axis bounds). This effect can cause labels to overlap with each other, but generally it does not occur in normal scenarios. This is enabled by default.

     // Example, disable
    chart.axisX.setKeepTickLabelsInAxisBounds(false)

    Returns

    Object itself

    Parameters

    • enabled: boolean

      Boolean

    Returns Axis

  • Beta

    Configure length of axis. E.g. height for Y axis, width for X axis.

    Axis length can be set in two ways:

    • Relative length
    • Length as pixels

    Relative length

    Set relative size of axis in its own "Stack".

    For example, if you have a chart with 2 stacked Y axes, by default they will have equal heights. By altering axis relative size, you can adjust how the chart height is distributed between these two axes.

    By default, every axis length is set to { relative: 1 }

     // Example scenario
    const chart = lightningChart().ChartXY()
    const y1 = chart.getDefaultAxisY().setTitle('Y 1').setLength({ relative: 2 })
    const y2 = chart.addAxisY({ iParallel: 0, iStack: 1 }).setTitle('Y 2')

    Length as pixels

    Hardcoded length as pixels.

     // Example scenario
    const chart = lightningChart().ChartXY()
    const y1 = chart.getDefaultAxisY().setTitle('Y 1').setLength({ pixels: 200 })
    const y2 = chart.addAxisY({ iParallel: 0, iStack: 1 }).setTitle('Y 2')
    Released in v5.2. API may be changed according to user feedback and comments.
    

    Parameters

    • length: {
          pixels: number;
      } | {
          relative: number;
      }

    Returns Axis

  • Specifies Padding after axis ticks.

    Returns

    Axis itself for fluent interface

    Parameters

    • margin: number

      Gap after axis ticks

    Returns Axis

  • Specifies padding after Axis title. This is only accounted when title is visible.

    Returns

    Axis itself for fluent interface

    Parameters

    • margin: number

      Gap between the title and the next axis in pixels. Can also affect chart margins

    Returns Axis

  • Beta

    Add empty space at either end of the axis, without affecting the relative size of the Axis.

     // Example, 20 pixels margin at "start" side of Axis.
    Axis.setMargins(20, 0)
    Released in v5.2. API may be changed according to user feedback and comments.
    

    Parameters

    • startMarginPx: number
    • endMarginPx: number

    Returns Axis

  • Set whether element can be target of pointer events or not.

    Disabling pointer events means that the objects below this component can be interacted through it.

    Returns

    Object itself for fluent interface

    Parameters

    • state: boolean

      Specifies state of mouse interactions

    Returns Axis

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

  • Set style of Axis line stroke.

    Supported line styles:

     // 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 or y 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 Axis

  • Set Axis thickness as pixels.

    For X Axis, this means Axis height.

    For Y Axis, this means Axis width.

     // Example syntax,
    Axis.setThickness( 60 )

    Returns

    Object itself for fluent interface.

    Parameters

    • thickness: undefined | number

      Explicit thickness of Axis as pixels.

    Returns Axis

  • Configure Axis thickness min/max limits as pixels.

    The thickness of Axis is calculated based on ticks, title, axis line, etc. By setting min and/or max thickness, the size allocated for Axis can be restricted to desired limits.

    For X Axis, this means Axis height.

    For Y Axis, this means Axis width.

     // Example syntax, set axis to at least 100 px thick, but allow larger axis thickness if labels are large, or other such scenario.
    Axis.setThickness({ min: 100, max: undefined })

    Returns

    Object itself for fluent interface.

    Parameters

    • thickness: {
          max?: number;
          min?: number;
      }

      Explicit thickness of Axis as pixels.

      • Optional max?: number
      • Optional min?: number

    Returns Axis

  • Specifies an Axis title string

    Returns

    Axis itself for fluent interface

    Parameters

    • title: string

      Axis title as a string

    Returns Axis

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

  • Set axis title position (if any)

     // Example, place title inside series area.
    ChartXY.setTitlePosition(AxisXYTitlePositionOptions.Start)

    ChartXY.setTitlePosition('end')

    Returns

    Object itself.

    Parameters

    • position: "center" | "end" | "start"

      Position selection.

    Returns Axis

  • Set rotation of Axis title.

    Returns

    Object itself

    Parameters

    • value: number

      Rotation in degrees

    Returns Axis

  • Beta

    Set unit that Axis measures. e.g. "Hz", or "°C". This is a convenience API that affects following things:

    • The unit is displayed after the Axis title (if it is defined). e.g. "Axis title (Hz)"
    • Default cursor formatters place the Unit next to units of the Axis.
     // Example syntax
    axis
    .setTitle('Frequency')
    .setUnits('Hz')

    axis.setUnits('Hz', { displayOnAxis: false })

    Returns

    Object itself.

                Introduced in LightningChart JS v6.0.0. Behavior or API might change in following versions depending on user feedback.
    

    Parameters

    • units: undefined | string

      String or undefined.

    • behavior: AxisUnitsBehavior = {}

      Optional extra argument to control which side effects of configuring Units are enabled.

    Returns Axis

  • Beta

    Configure user interactions from a set of preset options.

    Without any explicit configuration, the charts select the default user interaction scheme based on available information, such as axis types, attached series and data supplied to series.

    The setUserInteraction methods allow explicitly configuring the used interaction scheme.

     // Example, disable panning
    axis.setUserInteractions({
    pan: false
    })
     // LMB pan, RMB rectangle zoom
    axis.setUserInteractions({
    pan: {
    lmb: { drag: true },
    rmb: false,
    },
    rectangleZoom: {
    lmb: false,
    rmb: { drag: true },
    },
    })
     // Example, disable all interactions
    axis.setUserInteractions(undefined)

    Returns

    Object itself.

    Introduced in v7.0.0. API may change according to user feedback.
    

    Parameters

    Returns Axis

  • Set element visibility.

    Returns

    Object itself.

    Parameters

    • state: boolean

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

    Returns Axis

  • Zoom scale from/to a position.

    Used by ChartXY as well as Axis itself.

    Parameters

    • referencePosition: number

      Position to zoom towards or from on axis

    • zoomDirection: number

      Amount and direction of zoom [-1, 1] as a guideline

    Returns void