Interface ParallelCoordinateAxisCustomTick

End user managed Axis Tick in a ParallelCoordinateChart. Custom ticks are just like default ticks, except they can be completely controlled by the end user.

For example, their position, text, text fill style, gridline style, etc. everything can be customized. They can be created whenever and destroyed whenever.

They are created with addCustomTick method, and destroyed with dispose method.

 // Example
const customTick = ParallelCoordinateChart.getAxis(0).addCustomTick()
// Tick position on Axis.
.setValue(100)
.setTextFormatter((value) => `Custom tick at ${value.toFixed(1)}`)

Default Axis ticks can be hidden by selecting empty tick strategy.

 // Remove default ticks.
ParallelCoordinateChart.getAxis(0).setTickStrategy(AxisTickStrategies.Empty)

Hierarchy

Properties

getVisible: (() => boolean)

Type declaration

    • (): boolean
    • Get element visibility.

      Returns

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

      Returns boolean

setVisible: ((state: boolean) => ParallelCoordinateAxisCustomTick)

Type declaration

Methods

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

    Parameters

    • type: "dispose"
    • listener: ((event: DisposeEvent, info: unknown) => unknown)

      Callback function that is triggered when event is fired.

    • Optional options: LCJSAddEventListenerOptions

      Optional extra configuration options.

    Returns void

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Get alignment of Label respective to tick line.

    Returns

    alignment [-1, 1].

    Returns number

  • Get mouse interactions enabled or disabled.

    Returns

    Mouse interactions state

    Returns boolean

  • Get padding between CustomTick tickline and text.

    Returns

    Padding as pixels

    Returns number

  • Get location of custom tick on its Axis.

    Returns

    Location on axis.

    Returns number

  • Check whether the object is disposed. Disposed objects should not be used!

    Returns

    true if object is disposed.

    Returns boolean

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

    Parameters

    • type: "dispose"
    • listener: ((event: DisposeEvent, info: unknown) => unknown)

      Listener that was added using addEventListener.

    Returns void

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Set text formatting of custom tick as a callback function.

     // Example usage
    CustomTick.setTextFormatter((value) => `Custom tick at ${value.toFixed(1)}`)

    The supplied callback function is called with the current axis location of the custom tick. To provide hard defined text, just ignore the value.

     // Example, hard defined custom tick text.
    CustomTick.setTextFormatter(() => `My tick text`)

    Returns

    Object itself

    Parameters

    • textFormatter: ((value: number) => string)

      Callback function which returns custom tick text as string.

        • (value: number): string
        • Parameters

          • value: number

          Returns string

    Returns ParallelCoordinateAxisCustomTick