Interface for supplying an Array of X data to a component.

Given data is expected to be number values, which will be transformed into an array of XY-compatible points. This method is for end user utility, and simply transform given data to the format of add(). As such, they cause additional performance overhead, so use add() whenever possible.

Hierarchy

  • DataInputX

Implemented by

Methods

Methods

  • Append new data points into the series by only supplying X coordinates.

     // Example syntax, number array
    LineSeries.addArrayX([ 5, 1, 2, 0 ])

    This method supports binary data input by using Typed arrays. If your data comes in any binary format, then using the typed array syntax is recommended for best performance.

     // Example syntax, typed array (Float32)
    const float32Array = new Float32Array(4)
    float32Array[0] = 5
    float32Array[1] = 1
    float32Array[2] = 2
    float32Array[3] = 0
    LineSeries.addArrayX(float32Array)

    Each X coordinate will be paired with an automatically generated Y coordinate.

    By default, this continues from the last data point in the series. However, the behavior of assigning Y coordinates can be controlled with the optional step and start parameters.

    Returns

    Object itself for fluent interface.

    Parameters

    • arrayX: number[] | TypedArray

      Array of X-values.

    • Optional step: number

      Optional step between each Y coordinate. Defaults to 1.

    • Optional start: number

      Optional value for first generated Y-value. Defaults to 0.

    Returns DataInputX