Interface UILUTRange<BackgroundType>

Interface for UILUTRange, UI element which displays a color lookup table range with labels.

Type Parameters

Hierarchy

Properties

draggable: boolean

Reference to HTML draggable attribute

Essentially part of convenience functionality which allows you to specify specific LCJS elements as "draggable", this information is automatically passed on to the LCJS charts container DIV when that element is pointed (since LCJS elements are not HTML elements, the DIV is the only actual HTML element).

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.

    Type Parameters

    Parameters

    Returns void

  • Get elements Background object

    Type of Background is generic, see UIBackground for minimum interface.

    Returns

    Background object

    Returns BackgroundType

  • 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 state of component highlighting.

    Returns

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

    Returns number

  • Get attached LUT (color look up table).

    Returns

    (color look up table).

    Returns undefined | LUT

  • Get length of LUT box as pixels.

    Returns

    Length as pixels.

    Returns number

  • Get thickness of LUT box as pixels.

    Returns

    Thickness as pixels.

    Returns number

  • Get displayed unit of Look Up Values. For example, "mm/h" (millimetres per hour).

    Returns

    String to display next to Look Up Values.

    Parameters

    • unit: string

    Returns string

  • Get padding around object in pixels. Padding is empty space between the UiElements content and Background

    Returns

    Margin datastructure

    Returns Margin

  • Get rotation of Label.

    Returns

    Rotation in degrees

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

    Type Parameters

    Parameters

    Returns void

  • 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 UILUTRange<BackgroundType>

  • 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 UILUTRange<BackgroundType>

  • Set attached LUT (color look up table).

    Returns

    Object itself.

    Parameters

    • lut: LUT

      LUT (color look up table).

    Returns UILUTRange<BackgroundType>

  • Set length of LUT box as pixels.

    Parameters

    • lengthPixels: number

      Length as pixels.

    Returns UILUTRange<BackgroundType>

  • Specify step value formatting of LUT Legend.

    Example usage:

     // Display one fraction.
    setStepValueFormatter((step, lut) => step.value.toFixed(1))

    Parameters

    • formatter: ((step: LUTStep, lut: LUT) => string)

      Callback function that receives the LUTStep object created by user, and maps it into a string that is displayed in the label.

    Returns UILUTRange<BackgroundType>

  • Set thickness of LUT box as pixels.

    Parameters

    • thicknessPixels: number

      Thickness as pixels.

    Returns UILUTRange<BackgroundType>

  • Set displayed unit of Look Up Values. For example, "mm/h" (millimetres per hour).

    Returns

    Object itself.

    Parameters

    • unit: string

      String to display next to Look Up Values.

    Returns UILUTRange<BackgroundType>

  • Set margin around object in pixels.

    Returns

    Object itself

    Parameters

    • margin: number | Partial<MMargin>

      Number with pixel margins for all sides or datastructure with individual pixel margins for each side. Any side can be omitted, only passed values will be overridden.

    Returns UILUTRange<BackgroundType>

  • Set padding around object in pixels. Padding is empty space between the UiElements content and Background

    Returns

    Object itself

    Parameters

    • padding: number | Partial<Margin>

      Number with pixel margins for all sides or datastructure with individual pixel paddings for each side. Any side can be omitted, only passed values will be overridden.

    Returns UILUTRange<BackgroundType>

  • Set mouse interactions enabled or disabled

    Returns

    Object itself for fluent interface

    Parameters

    • state: boolean

      Specifies state of mouse interactions

    Returns UILUTRange<BackgroundType>