Class that describes an Icon, a relatively small graphic that can be used with different LightningChart JS components.

Icons can be created by supplying a graphic source and optionally a desired size for the Icon.

To learn more, see addCustomIcon.

Hierarchy

  • IconRecord
    • Icon

Implements

Properties

height: undefined | number

Explicit height as pixels, or undefined to use source size.

If only height is specified, then icon width is automatically scaled to maintain source aspect ratio.

width: undefined | number

Explicit width as pixels, or undefined to use source size.

If only width is specified, then icon height is automatically scaled to maintain source aspect ratio.

Methods

  • Inform the engine owning the Icon that it is no longer used.

    Afterwards, there is no guarantee that the Icon will work.

    It is recommended to dispose all user defined Icons that are no longer needed. In the short term, there is no large significance in retaining Icons that may be temporarily unused. Disposing Icons is recommended more for the long term effects, such as avoiding permanent memory leaks that may show only over long runtimes.

     // Example, inform engine that an Icon is no longer needed.
    icon.dispose()

    Returns

    The object itself.

    Returns Icon

  • Get value of height property.

    This is not equal to the actual visible height of the Icon! There is currently no method for accessing that value.

    Returns

    Icon height value.

    Returns undefined | number

  • Get value of width property.

    This is not equal to the actual visible width of the Icon! There is currently no method for accessing that value.

    Returns

    Icon width value.

    Returns undefined | number

  • Construct a new Icon that is otherwise identical to this one, except with modified height value.

    To confirm, this does not modify the Icon object at all, and returns a reference to a brand new Icon.

    Returns

    A new Icon object.

    Parameters

    • height: undefined | number

      Icon height as pixels.

    Returns Icon

  • Construct a new Icon that is otherwise identical to this one, except with modified size.

    To confirm, this does not modify the Icon object at all, and returns a reference to a brand new Icon.

    Returns

    A new Icon object.

    Parameters

    • width: number

      Icon width as pixels.

    • height: number

      Icon height as pixels.

    Returns Icon

  • Construct a new Icon that is otherwise identical to this one, except with modified width value.

    To confirm, this does not modify the Icon object at all, and returns a reference to a brand new Icon.

    Returns

    A new Icon object.

    Parameters

    • width: undefined | number

      Icon width as pixels.

    Returns Icon