Series that can visualize any combination of Lines, Points and Area filling.

Also supports different preprocessing options (step/spline/disabled).

This series is a beta version with severe performance optimizations compared to old XY series. It is significantly more memory efficient and can handle much more data more efficiently than the old series versions.

It introduces drafts for new end user APIs for many purposes, like more logical automatic data cleaning configuration, modifying visualization type during run-time, etc.

For beta purposes, this is introduced as a separate series type. After official release, it will merge into the old APIs, like addLineSeries, addPointSeries, etc.

For more information and documentation, please see "XY features rework" in Developer Documentation. https://lightningchart.com/js-charts/docs/basic-topics/beta-xy/

Creating PointLineAreaSeries:

PointLineAreaSeries are created with addPointLineAreaSeries method.

Some properties of PointLineAreaSeries can only be configured when it is created. These arguments are all optional, and are wrapped in a single object parameter:

 // Example,
const series = ChartXY.addPointLineAreaSeries({
// Specify non-default X Axis to attach series to.
xAxis: myNonDefaultAxisX
})

To learn about available properties, refer to PointLineAreaSeriesOptions.

Examples:

Different data visualizations can be achieved simply by changing the style of the series.

 // Area series
const series = ChartXY.addPointLineAreaSeries({ dataPattern: 'ProgressiveX' })
 // Point-Line series
const series = ChartXY.addPointLineAreaSeries({ dataPattern: 'ProgressiveX' })
.setAreaFillStyle(emptyFill)
 // Point series
const series = ChartXY.addPointLineAreaSeries({ dataPattern: null })
.setAreaFillStyle(emptyFill)
.setStrokeStyle(emptyLine)
 // Step series
const series = ChartXY.addPointLineAreaSeries({ dataPattern: 'ProgressiveX' })
.setAreaFillStyle(emptyFill)
.setCurvePreprocessing({ type: 'step', step: 'middle' })
 // Spline series
const series = ChartXY.addPointLineAreaSeries({ dataPattern: 'ProgressiveX' })
.setAreaFillStyle(emptyFill)
.setCurvePreprocessing({ type: 'spline' })
This feature is currently in public beta. It may change in near future or receive rapid patches according to user feedback and experiences.

Hierarchy

Implements

Properties

Methods

Properties

_isCursorEnabled: boolean = true

Active state of Cursor

axisX: Axis
axisY: Axis
scale: LinearScaleXY

Scale of the series

Methods

  • Add data as { x: number, y: number } objects.

    This method exists only for backwards compatibility reasons. Using appendJSON is recommended instead.

    Returns

    Object itself.

    Deprecated

    Use appendJSON instead

    Parameters

    • data: {
          x: number;
          y: number;
      }[] | {
          x: number;
          y: number;
      }

    Returns PointLineAreaSeries

  • Add data as number[] number[]

    This method exists only for backwards compatibility reasons. Using appendSamplesXY is recommended instead.

    Returns

    Object itself.

    Deprecated

    Use appendSamplesXY instead

    Parameters

    • xArray: number[]
    • yArray: number[]

    Returns PointLineAreaSeries

  • Add Marker to the Series.

    Returns

    SeriesMarkerXY

    Type Parameters

    • ResultTableBackgroundType extends UIBackground<ResultTableBackgroundType>

    Parameters

    • cursorBuilder: StaticCursorXYBuilder<ResultTableBackgroundType> = ...

      Optional StaticCursorBuilderXY to customize the markers background shape (defaults to rectangle). See MarkerBuilders for example.

    Returns SeriesMarkerXY<ResultTableBackgroundType>

  • Alter existing samples in the data set. This method also supports automatically appending samples when attempting to alter samples that don't exist in data set.

    This method alters existing samples by referencing sample indexes. This simply refers to a incrementing counter of when each sample was first introduced. For example, 0 refers to first sample that was added to data set. When data cleaning is enabled, sample indexes do NOT shift. They always point to unique samples, even if old samples are removed.

     // Example, basic usage - set first sample to { x: 0, y: 0 }
    DataSetXY.alterSamples(0, {
    xValues: [0],
    yValues: [1]
    })
     // Example, alter several samples at once - set first sample to { x: 0, y: 10 }, second sample to { x: 1, y: 11 } and so on.
    DataSetXY.alterSamples(0, {
    xValues: [0, 1, 2],
    yValues: [10, 11, 12]
    })
     // Example, alter last sample to have Y = 0.
    DataSetXY.alterSamples(DataSetXY.getNextSampleIndex() - 1, {
    yValues: [0]
    })

    See also alterSamplesByID.

    Returns

    Object itself.

    Parameters

    • iSampleMin: number

      First altered sample index.

    • values: {
          colors?: number[] | Uint32Array | Color[];
          count?: number;
          ids?: number[] | Uint32Array;
          lookupValues?: number[] | Float32Array;
          offset?: number;
          offsetColors?: number;
          offsetIds?: number;
          offsetLookupValues?: number;
          offsetRotations?: number;
          offsetSizes?: number;
          rotations?: number[] | Float32Array;
          sizes?: number[] | Float32Array;
          xValues?: number[] | TypedArray;
          yValues?: number[] | TypedArray;
      }

      Object with new sample values. Behaves same as appendSamples.

      • Optional colors?: number[] | Uint32Array | Color[]
      • Optional count?: number
      • Optional ids?: number[] | Uint32Array
      • Optional lookupValues?: number[] | Float32Array
      • Optional offset?: number
      • Optional offsetColors?: number
      • Optional offsetIds?: number
      • Optional offsetLookupValues?: number
      • Optional offsetRotations?: number
      • Optional offsetSizes?: number
      • Optional rotations?: number[] | Float32Array
      • Optional sizes?: number[] | Float32Array
      • Optional xValues?: number[] | TypedArray
      • Optional yValues?: number[] | TypedArray

    Returns PointLineAreaSeries

  • Alter existing samples in the data set.

    This method alters existing samples by referencing their ID properties. The ID property is an optional sample number property, which CAN be specified by the user. They have to be enabled using ids and afterwards can be added alongside other data properties, like x, y, etc.

     // Example, basic usage
    const dataSet = new DataSetXY({ ids: true })
    dataSet.appendSamples({
    ids: [0, 1, 2],
    yValues: [10, 12, 7],
    })
    dataSet.alterSamplesByID([1], {
    yValues: [20]
    })
    // result yValues = [10, 20, 7]

    See also alterSamples.

    Returns

    Object itself.

    Parameters

    • ids: number[] | Uint32Array

      List of sample IDs that are altered.

    • values: {
          colors?: number[] | Uint32Array | Color[];
          ids?: number[] | Uint32Array;
          lookupValues?: number[] | Float32Array;
          rotations?: number[] | Float32Array;
          sizes?: number[] | Float32Array;
          xValues?: number[] | TypedArray;
          yValues?: number[] | TypedArray;
      }

      Object with new sample values. Behaves same as appendSamples.

      • Optional colors?: number[] | Uint32Array | Color[]
      • Optional ids?: number[] | Uint32Array
      • Optional lookupValues?: number[] | Float32Array
      • Optional rotations?: number[] | Float32Array
      • Optional sizes?: number[] | Float32Array
      • Optional xValues?: number[] | TypedArray
      • Optional yValues?: number[] | TypedArray

    Returns PointLineAreaSeries

  • Add several samples from JSON by reading values from instructed property names.

     // Example, read x + y
    const arr = [{ x: 0, y: 0 }]
    DataSetXY.appendJSON(arr, { x: 'x', y: 'y' })
     // Example, read custom property names
    const arr = [{ timestamp: 0, voltage: 0 }]
    DataSetXY.appendJSON(arr, { x: 'timestamp', y: 'voltage' })
     // Example, only Y values
    const arr = [{ price: 0 }]
    DataSetXY.appendJSON(arr, { y: 'price' })
     // Example, color values
    const arr = [{ x: 0, y: 0, color: 0xff0000ff }]
    DataSetXY.appendJSON(arr, { x: 'x', y: 'y', color: 'color' })

    Please note that before adding optional values (lookup values, ids or colors), they need to be enabled using colors or equivalent!

    Supported sample property types:

    • x: number
    • y: number
    • lookupValue: number
    • id: number
    • color: either Color object or number which represents a Uint32 RGBA color with Red channel being least significant byte. Note that using Color objects in large quantities should be avoided for performance reasons.

    Returns

    Object itself.

    Type Parameters

    • T extends {
          [key: string]: unknown;
      }

    Parameters

    • array: T[]

      Array with JSON objects which represent samples.

    • Optional arg: {
          color?: keyof T;
          id?: keyof T;
          lookupValue?: keyof T;
          rotation?: keyof T;
          size?: keyof T;
          start?: number;
          step?: number;
          x?: keyof T;
          y?: keyof T;
      }

      Object which informs which property names contain data. At least x or y property should always be specified.

      • Optional color?: keyof T
      • Optional id?: keyof T
      • Optional lookupValue?: keyof T
      • Optional rotation?: keyof T
      • Optional size?: keyof T
      • Optional start?: number
      • Optional step?: number
      • Optional x?: keyof T
      • Optional y?: keyof T

    Returns PointLineAreaSeries

  • Add 1 sample to data set.

     // Example, basic usage
    DataSetXY.appendSample({ x: 0, y: 0 })
     // Example, only Y value with automatic X step
    DataSetXY.appendSample({ y: 0, step: 1 })
     // Example, extra properties (color)
    DataSetXY.appendSample({ x: 0, y: 0, color: 0xff0000ff })

    Please note that before adding optional values (lookup values, ids or colors), they need to be enabled using colors or equivalent!

    Supported sample property types:

    • x: number
    • y: number
    • lookupValue: number
    • id: number
    • size: number
    • rotation: number
    • color: either Color object or number which represents a Uint32 RGBA color with Red channel being least significant byte. Note that using Color objects in large quantities should be avoided for performance reasons.

    Returns

    Object itself.

    Parameters

    • arg: {
          color?: number | Color;
          id?: number;
          lookupValue?: number;
          rotation?: number;
          size?: number;
          step?: number;
          x?: number;
          y?: number;
      }

      Object any data properties (x, y, lookupValue, color, id, size, rotation).

      • Optional color?: number | Color
      • Optional id?: number
      • Optional lookupValue?: number
      • Optional rotation?: number
      • Optional size?: number
      • Optional step?: number
      • Optional x?: number
      • Optional y?: number

    Returns PointLineAreaSeries

  • Add a list of samples to data set.

     // Example, basic usage.
    DataSetXY.appendSamples({
    xValues: [0, 1, 2],
    yValues: [100, 101, 102],
    })
     // Example, only Y values with automatic X step
    DataSetXY.appendSamples({
    yValues: [100, 101, 102],
    start: 0,
    step: 1,
    })
     // Example, typed array input.
    DataSetXY.appendSamples({
    yValues: new Float32Array([100, 101, 102]),
    })
     // Example, extra properties (color)
    DataSetXY.appendSamples({
    xValues: [0, 1, 2],
    yValues: [100, 101, 102],
    colors: [0xff0000ff, 0xff00ff00, 0xffff0000]
    })

    Please note that before adding optional values (lookup values, ids or colors), they need to be enabled using colors or equivalent!

    Supported sample property types:

    • x: number
    • y: number
    • lookupValue: number
    • id: number
    • size: number
    • rotation: number
    • color: either Color object or number which represents a Uint32 RGBA color with Red channel being least significant byte. Note that using Color objects in large quantities should be avoided for performance reasons.

    offset properties can optionally be used to start reading values from middle of input array. Can be situationally useful.

    Returns

    Object itself.

    Parameters

    • arg: {
          colors?: number[] | Uint32Array | Color[];
          count?: number;
          ids?: number[] | Uint32Array;
          lookupValues?: number[] | Float32Array;
          offset?: number;
          offsetColors?: number;
          offsetIds?: number;
          offsetLookupValues?: number;
          offsetRotations?: number;
          offsetSizes?: number;
          rotations?: number[] | Float32Array;
          sizes?: number[] | Float32Array;
          start?: number;
          step?: number;
          xValues?: number[] | TypedArray;
          yValues?: number[] | TypedArray;
      }

      Object with data properties and optional behavior configurations.

      • Optional colors?: number[] | Uint32Array | Color[]
      • Optional count?: number
      • Optional ids?: number[] | Uint32Array
      • Optional lookupValues?: number[] | Float32Array
      • Optional offset?: number
      • Optional offsetColors?: number
      • Optional offsetIds?: number
      • Optional offsetLookupValues?: number
      • Optional offsetRotations?: number
      • Optional offsetSizes?: number
      • Optional rotations?: number[] | Float32Array
      • Optional sizes?: number[] | Float32Array
      • Optional start?: number
      • Optional step?: number
      • Optional xValues?: number[] | TypedArray
      • Optional yValues?: number[] | TypedArray

    Returns PointLineAreaSeries

  • Attach object to an legendBox entry

    Returns

    Series itself for fluent interface

    Parameters

    • entry: LegendBoxEntry<UIBackground>

      Object which has to be attached

    • toggleVisibilityOnClick: boolean = true

      Flag that indicates whether the Attachable should be hidden or not, when its respective Entry is clicked.

    • matchStyleExactly: boolean = false

      By default, entries are assigned a smooth looking gradient based on the component color. If this flag is true, then this is skipped, and exact component solid fill is used instead.

    Returns PointLineAreaSeries

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

  • Get component highlight animations enabled or not.

    Returns

    Animation enabled?

    Returns boolean

  • Get current area fill style.

    Returns

    FillStyle object.

    Returns FillStyle

  • Get whether series is taken into account with automatic scrolling and fitting of attached axes.

    By default, this is true for all series.

    Returns

    true default, axes will take series into account in scrolling and fitting operations. false, axes will ignore series boundaries.

    Returns boolean

  • Returns

    Whether Cursor is enabled or not

    Returns boolean

  • Get if cursor interpolates solved data-points along series by default.

    Cursor interpolation is only supported if the LineSeries follows a progressive data-pattern, refer to addLineSeries for more information on data-patterns.

    Returns

    Boolean flag

    Returns boolean

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

    In case highlight animations are enabled, this method returns the unanimated highlight value.

    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 boolean flag for whether object is currently under mouse or not

    Returns

    Boolean for is object under mouse currently

    Returns boolean

  • Get current configured maximum sample count. See setMaxSampleCount for more information.

    Returns

    Number of undefined.

    Returns undefined | number

  • Get mouse interactions enabled or disabled. Disabled mouse-interactions will naturally prevent mouse-driven highlighting from ever happening.

    Returns

    Mouse interactions state

    Returns boolean

  • Get the name of the Component.

    Returns

    The name of the Component.

    Returns string

  • Get next new sample index. This also counts old samples that have been dropped out by data cleaning logic.

    Returns

    Number.

    Returns number

  • Get current markers fill style.

    Returns

    FillStyle object.

    Returns FillStyle

  • Get the current rotation of points as degrees.

    Returns number

  • Get current shape of displayed points.

    Returns

    PointShape.

    Returns PointShape

  • Get current size of points in pixels.

    Returns

    Size of point in pixels.

    Returns number

  • Get number of samples currently existing in the data set. This does NOT count any samples that have been dropped out by data cleaning logic.

    Returns

    Number.

    Returns number

  • Get stroke style of Series.

    Returns

    LineStyle object

    Returns LineStyle

  • Get element visibility.

    Returns

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

    Returns boolean

  • Returns

    Max X value of the series

    Returns undefined | number

  • Returns

    Min X value of the series

    Returns undefined | number

  • Returns

    Max Y value of the series

    Returns undefined | number

  • Returns

    Min Y value of the series

    Returns undefined | number

  • Remove event listener from dispose event.

    Returns

    True if the listener is successfully removed and false if it is not found

    Parameters

    • token: Token

      Token of event listener which has to be removed

    Returns boolean

  • Unsubscribe from Highlight object event. This is called whenever an object is highlighted

    Returns

    True if the unsubscription was successful.

    Parameters

    • token: Token

      Token that was received when subscribing to the event.

    Returns boolean

  • Unsubscribe from event when configured max sample count is exceeded.

     // Example
    const token = DataSetXY.onMaxSampleCountExceeded((dataSet, currentSampleCount, currentMaxSampleCount, newTotalSampleCount) => {})
    DataSetXY.offMaxSampleCountExceeded(token)

    Parameters

    • token: Token

      Token received from subscribing to corresponding event.

    Returns boolean

  • Remove event listener from Mouse Click Event

    Returns

    True if the listener is successfully removed and false if it is not found

    Parameters

    • token: Token

      Token of event listener which has to be removed

    Returns boolean

  • Remove event listener from Mouse Double Click Event

    Returns

    True if the listener is successfully removed and false if it is not found

    Parameters

    • token: Token

      Token of event listener which has to be removed

    Returns boolean

  • Remove event listener from Mouse Down Event

    Returns

    True if the listener is successfully removed and false if it is not found

    Parameters

    • token: Token

      Token of event listener which has to be removed

    Returns boolean

  • Remove event listener from Mouse Drag Event

    Returns

    True if the listener is successfully removed and false if it is not found

    Parameters

    • token: Token

      Token of event listener which has to be removed

    Returns boolean

  • Remove event listener from Mouse Drag Start Event

    Returns

    True if the listener is successfully removed and false if it is not found

    Parameters

    • token: Token

      Token of event listener which has to be removed

    Returns boolean

  • Remove event listener from Mouse Drag Stop Event

    Returns

    True if the listener is successfully removed and false if it is not found

    Parameters

    • token: Token

      Token of event listener which has to be removed

    Returns boolean

  • Remove event listener from Mouse Enter Event

    Returns

    True if the listener is successfully removed and false if it is not found

    Parameters

    • token: Token

      Token of event listener which has to be removed

    Returns boolean

  • Remove event listener from Mouse Leave Event

    Returns

    True if the listener is successfully removed and false if it is not found

    Parameters

    • token: Token

      Token of event listener which has to be removed

    Returns boolean

  • Remove event listener from Mouse Move Event

    Returns

    True if the listener is successfully removed and false if it is not found

    Parameters

    • token: Token

      Token of event listener which has to be removed

    Returns boolean

  • Remove event listener from Mouse Up Event

    Returns

    True if the listener is successfully removed and false if it is not found

    Parameters

    • token: Token

      Token of event listener which has to be removed

    Returns boolean

  • Remove event listener from Mouse Wheel Event

    Returns

    True if the listener is successfully removed and false if it is not found

    Parameters

    • token: Token

      Token of event listener which has to be removed

    Returns boolean

  • Remove event listener from Touch End Event

    Returns

    True if the listener is successfully removed and false if it is not found

    Parameters

    • token: Token

      Token of event listener which has to be removed

    Returns boolean

  • Remove event listener from Touch Move Event

    Returns

    True if the listener is successfully removed and false if it is not found

    Parameters

    • token: Token

      Token of event listener which has to be removed

    Returns boolean

  • Remove event listener from Touch Start Event

    Returns

    True if the listener is successfully removed and false if it is not found

    Parameters

    • token: Token

      Token of event listener which has to be removed

    Returns boolean

  • Remove event listener from visibleStateChanged

    Parameters

    • token: Token

    Returns boolean

  • Subscribe onDispose event. This event is triggered whenever the ChartComponent is disposed.

     // Example usage

    lineSeries.onDispose(() => {
    console.log('lineSeries was disposed')
    })

    lineSeries.dispose()

    Returns

    Token of subscription

    Parameters

    Returns Token

  • Subscribe to highlight object event. This is called whenever an object is highlighted.

    Returns

    Token that can be used to unsubscribe from the event.

    Parameters

    Returns Token

  • Subscribe to event when configured max sample count is exceeded. This can be used to add custom logic to increase max sample count or not.

     DataSetXY.onMaxSampleCountExceeded((dataSet, currentSampleCount, currentMaxSampleCount, newTotalSampleCount) => {
    // Example, double max sample count
    dataSet.setMaxSampleCount(Math.max(currentMaxSampleCount * 2, newTotalSampleCount))
    })

    Returns

    Token that can be used to unsubscribe from event.

    Parameters

    • clbk: ((dataSet: DataSetXY, currentSampleCount: number, currentMaxSampleCount: number, newTotalSampleCount: number) => unknown)

      Function that is triggered on event.

        • (dataSet: DataSetXY, currentSampleCount: number, currentMaxSampleCount: number, newTotalSampleCount: number): unknown
        • Parameters

          • dataSet: DataSetXY
          • currentSampleCount: number
          • currentMaxSampleCount: number
          • newTotalSampleCount: number

          Returns unknown

    Returns Token

  • Read back the current contents of the data set.

     // Read back data
    const data = DataSetXY.readBack()
    console.log(data)

    If data cleaning (max sample count) is enabled, this can result in allocating new memory (and thus be expensive). Otherwise, a very efficient operation.

    The returned values should NOT be modified.

    Optionally, you can include the flag onlyInRange to find return only samples that are in specified range. This is only supported if the data set has a "data pattern" (e.g. { dataPattern: 'ProgressiveX' }). The range is always considered to be in the same dimension as this data pattern (e.g. X Axis).

     // Example, read back data that is visible
    ChartXY.getDefaultAxisX().onIntervalChange((axis, start, end) => {
    const data = DataSetXY.readBack({ onlyInRange: { start, end } })
    console.log(data)
    })

    This operation is not "pixel perfect", meaning it can often return 1 extra sample that is not visible (the next and/or previous ones).

    Returns

    Object with lists of separate data channels, like x coordinates, y coordinates, look up values, colors, etc.

    Parameters

    • Optional arg: {
          onlyInRange?: {
              end: number;
              start: number;
          };
      }
      • Optional onlyInRange?: {
            end: number;
            start: number;
        }
        • end: number
        • start: number

    Returns {
        colors?: Uint32Array;
        ids?: Uint32Array;
        lookupValues?: Float32Array;
        rotations?: Float32Array;
        sizes?: Float32Array;
        xValues: TypedArray;
        yValues: TypedArray;
    }

    • Optional colors?: Uint32Array
    • Optional ids?: Uint32Array
    • Optional lookupValues?: Float32Array
    • Optional rotations?: Float32Array
    • Optional sizes?: Float32Array
    • xValues: TypedArray
    • yValues: TypedArray
  • 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 PointLineAreaSeries

  • Set fill style of area under the series trend.

    Supported fill styles:

    SolidFill:

    Solid color for entire area fill.

     // Example, solid colored area fill.
    PointLineAreaSeries.setAreaFillStyle(new SolidFill({ color: ColorRGBA(255, 0, 0) }))

    To learn more about available Color factories, see ColorRGBA

    PalettedFill:

    Supports following look-up modes: x, y and value.

    lookUpProperty: 'x' | 'y':

    Color dynamically based on x or y coordinate.

     // Example, dynamic color by Y coordinates
    PointLineAreaSeries.setAreaFillStyle(new PalettedFill({
    lookUpProperty: 'y',
    lut: new LUT({
    interpolate: true,
    steps: [
    { value: 0, color: ColorRGBA(255, 0, 0) },
    { value: 100, color: ColorRGBA(0, 255, 0) },
    ]
    })
    }))

    To learn more about Color lookup tables, see LUT.

    lookUpProperty: 'value':

    Color dynamically based on separately supplied value data set. values are specified when adding data points.

     // Example, dynamic color by Value data set
    const series = ChartXY.addPointLineAreaSeries({ lookupValues: true })
    .setAreaFillStyle(new PalettedFill({
    lookUpProperty: 'value',
    lut: new LUT({
    interpolate: true,
    steps: [
    { value: 0, color: ColorRGBA(255, 0, 0) },
    { value: 100, color: ColorRGBA(0, 255, 0) },
    ]
    })
    }))
    .appendSamples({
    yValues: [0, 1],
    lookupValues: [0, 100]
    })

    Data point lookup value properties have to be explicitly enabled before they can be used, see lookupValues for more details.

    To learn more about Color lookup tables, see LUT.

    IndividualPointFill:

    Color area fill with individually picked sample colors. Colors are interpolated between data points.

     // Example, individual colors
    const series = ChartXY.addPointLineAreaSeries({ colors: true })
    .setAreaFillStyle(new IndividualPointFill())
    .appendSamples({
    yValues: [0, 1],
    colors: [0xff0000ff, 0xff00ff00]
    })

    Data point color properties have to be explicitly enabled before they can be used, see colors for more details.

    LinearGradientFill:

    Color area fill with a linear gradient.

     // Example, linear gradient area fill
    PointLineAreaSeries.setAreaFillStyle(new LinearGradientFill())

    To learn more about linear gradient configurations, see LinearGradientFill.

    RadialGradientFill:

    Color area fill with a radial gradient.

     // Example, radial gradient line color
    PointLineAreaSeries.setAreaFillStyle(new RadialGradientFill())

    To learn more about radial gradient configurations, see RadialGradientFill.

    Returns

    Object itself for fluent interface.

    Parameters

    Returns PointLineAreaSeries

  • Set whether series is taken into account with automatic scrolling and fitting of attached axes.

    By default, this is true for all series.

    By setting this to false, any series can be removed from axis scrolling/fitting.

     // Example syntax, remove series from automatic scrolling / fitting.
    LineSeries.setAutoScrollingEnabled(false)

    Returns

    Object itself for fluent interface.

    Parameters

    • enabled: boolean

      true default, axes will take series into account in scrolling and fitting operations. false, axes will ignore series boundaries.

    Returns PointLineAreaSeries

  • Configure whether cursors should pick on this particular series or not.

     // Example, prevent chart auto cursor from snapping to a series.
    LineSeries.setCursorEnabled(false)

    Related API:

    Parameters

    • state: boolean

    Returns PointLineAreaSeries

  • Set if cursor interpolates solved data-points along series by default.

    Related API:

    NOTE: Cursor interpolation disables some features from working, for example:

    • lookupValue is not shared with result table formatter
    • id is not shared with result table formatter
    • [is not shared with result table formatter

    @param state - Boolean flag @returns Object itself for fluent interface @public](../interfaces/SampleXY.html#color)

    Parameters

    • state: boolean

    Returns PointLineAreaSeries

  • Configure formatting of Cursor ResultTable when pointing at this series.

     // Example usage
    LineSeries.setCursorResultTableFormatter((tableBuilder, series, sample) => {
    return tableBuilder
    .addRow(`Pointing at`, '', series.getName())
    .addRow(`X:`, '', sample.x.toFixed(1))
    .addRow(`Y:`, '', sample.y.toFixed(1))
    })

    The general syntax of configuring ResultTable formatting is shared between all series types; You specify a callback function, which receives a TableContentBuilder. The contents of the table are then set using methods of the table builder:

     // Using TableContentBuilder.
    LineSeries.setCursorResultTableFormatter((tableBuilder, series, sample) => {
    // addRow adds a list of strings to a new row in the table. Empty strings ('') will allocate any extra horizontal space within the row.
    tableBuilder
    .addRow('Item 0:', '', 'Value 0')
    .addRow('Item 1:', '', 'Value 1')
    .addRow('Long row that highlights the idea of empty strings')

    // After configuration, the table builder must be returned!
    return tableBuilder
    })

    Default Axis formatting can be referenced by using formatValue method.

    Related API:

    Returns

    Object itself

    Parameters

    Returns PointLineAreaSeries

  • Set data set which the series visualizes. This can be changed at any point.

    If data set is not set using this method, then the series creates it automatically as soon as data is pushed in.

     // Example
    const dataSet = new DataSetXY()
    PointLineAreaSeries.setDataSet(dataSet)

    Parameters

    Returns PointLineAreaSeries

  • Configure draw order of the series.

    The drawing order of series inside same chart can be configured by configuring their seriesDrawOrderIndex. This is a simple number that indicates which series is drawn first, and which last.

    The values can be any JS number, even a decimal. Higher number results in series being drawn closer to the top.

    By default, each series is assigned a running counter starting from 0 and increasing by 1 for each series.

        // Example, create 2 series and configure them to be drawn in reverse order.
    const series1 = ChartXY.addLineSeries()
    .setDrawOrder({ seriesDrawOrderIndex: 1 })
    const series2 = ChartXY.addLineSeries()
    .setDrawOrder({ seriesDrawOrderIndex: 0 })
        // Example, ensure a series is drawn above other series.
    SeriesXY.setDrawOrder({ seriesDrawOrderIndex: 1000 })

    Returns

    Object itself.

    Parameters

    • arg: {
          seriesDrawOrderIndex: number;
      }

      Object with seriesDrawOrderIndex property.

      • seriesDrawOrderIndex: number

    Returns PointLineAreaSeries

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

  • Set state of component highlighting.

     // Example usage

    component.setHighlight(true)

    component.setHighlight(0.5)

    If highlight animations are enabled (which is true by default), the transition will be animated. As long as the component is highlighted, the active highlight intensity will be animated continuously between 0 and the configured value. Highlight animations can be disabled with setAnimationHighlight

    Returns

    Object itself

    Parameters

    • highlight: number | boolean

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

    Returns PointLineAreaSeries

  • Set highlight on mouse hover enabled or disabled.

    Mouse interactions have to be enabled on the component for this to function as expected. See setMouseInteractions 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 PointLineAreaSeries

  • All real-time use cases (where data points are pushed in periodically) must define a "max sample count".

     // Example, keep maximum 1 million samples
    PointLineAreaSeries.setMaxSampleCount(1_000_000)

    This allocates the required amount of memory beforehand, which is crucial to get the best performance. After 1 million samples are reached, the oldest samples will start dropping out.

    Alternatively, if you are uncertain what value to use and don't want to allocate too much memory up-front, you can start small and automatically increase the buffer size as samples flow in:

     PointLineAreaSeries.setMaxSampleCount({ mode: 'auto', max: 10_000_000 })
    

    This would first allocate only small amount of memory, progressively increase memory allocation as samples come in until eventually limiting sample count to 10 million.

    Returns

    Object itself.

    Parameters

    • maxSampleCount: number

      Max sample count.

    Returns PointLineAreaSeries

  • All real-time use cases (where data points are pushed in periodically) must define a "max sample count".

     // Example, keep maximum 1 million samples
    PointLineAreaSeries.setMaxSampleCount(1_000_000)

    This allocates the required amount of memory beforehand, which is crucial to get the best performance. After 1 million samples are reached, the oldest samples will start dropping out.

    Alternatively, if you are uncertain what value to use and don't want to allocate too much memory up-front, you can start small and automatically increase the buffer size as samples flow in:

     PointLineAreaSeries.setMaxSampleCount({ mode: 'auto', max: 10_000_000 })
    

    This would first allocate only small amount of memory, progressively increase memory allocation as samples come in until eventually limiting sample count to 10 million.

    Returns

    Object itself.

    Parameters

    • arg: {
          max?: number;
          mode: "auto";
      }
      • Optional max?: number
      • mode: "auto"

    Returns PointLineAreaSeries

  • Set component mouse interactions enabled or disabled.

    Disabling mouse interactions means that the objects below this component can be interacted through it.

    Possible side-effects from disabling mouse interactions:

    • Mouse events are not triggered. For example, onMouseMove.
    • Mouse driven highlighting will not work.

    Returns

    Object itself for fluent interface

    Parameters

    • state: boolean

      Specifies state of mouse interactions

    Returns PointLineAreaSeries

  • Set fill style of markers displayed at sample locations.

    Supported fill styles:

    SolidFill:

    Solid color.

     // Example, solid colored markers
    PointLineAreaSeries.setPointFillStyle(new SolidFill({ color: ColorRGBA(255, 0, 0) }))

    To learn more about available Color factories, see ColorRGBA

    PalettedFill:

    Supports following look-up modes: x, y and value.

    lookUpProperty: 'x' | 'y':

    Color dynamically based on x or y coordinate.

     // Example, dynamic color by Y coordinates
    PointLineAreaSeries.setPointFillStyle(new PalettedFill({
    lookUpProperty: 'y',
    lut: new LUT({
    interpolate: true,
    steps: [
    { value: 0, color: ColorRGBA(255, 0, 0) },
    { value: 100, color: ColorRGBA(0, 255, 0) },
    ]
    })
    }))

    To learn more about Color lookup tables, see LUT.

    lookUpProperty: 'value':

    Color dynamically based on separately supplied value data set. values are specified when adding data points.

     // Example, dynamic color by Value data set
    const series = ChartXY.addPointLineAreaSeries({ lookupValues: true })
    .setPointFillStyle(new PalettedFill({
    lookUpProperty: 'value',
    lut: new LUT({
    interpolate: true,
    steps: [
    { value: 0, color: ColorRGBA(255, 0, 0) },
    { value: 100, color: ColorRGBA(0, 255, 0) },
    ]
    })
    }))
    .appendSamples({
    yValues: [0, 1],
    lookupValues: [0, 100]
    })

    Data point lookup value properties have to be explicitly enabled before they can be used, see lookupValues for more details.

    To learn more about Color lookup tables, see LUT.

    IndividualPointFill:

    Color by individually picked sample colors. Colors are interpolated between data points.

     // Example, individual colors
    const series = ChartXY.addPointLineAreaSeries({ colors: true })
    .setPointFillStyle(new IndividualPointFill())
    .appendSamples({
    yValues: [0, 1],
    colors: [0xff0000ff, 0xff00ff00]
    })

    Data point color properties have to be explicitly enabled before they can be used, see colors for more details.

    LinearGradientFill:

    Color with a linear gradient.

     // Example, linear gradient area fill
    PointLineAreaSeries.setPointFillStyle(new LinearGradientFill())

    To learn more about linear gradient configurations, see LinearGradientFill.

    RadialGradientFill:

    Color with a radial gradient.

     // Example, radial gradient line color
    PointLineAreaSeries.setPointFillStyle(new RadialGradientFill())

    To learn more about radial gradient configurations, see RadialGradientFill.

    Returns

    Object itself for fluent interface.

    Parameters

    Returns PointLineAreaSeries

  • Set the rotation of points in degrees.

     // Example syntax, rotate 45 degrees
    PointLineAreaSeries.setPointRotation(45)

    Point rotations can also be configured individually, see DataSetXY.rotations for more information.

    Parameters

    • angle: number

      Rotation angle in degrees

    Returns PointLineAreaSeries

  • Set size of point in pixels.

    Point sizes can also be configured individually, see DataSetXY.sizes for more information.

    Returns

    Object itself for fluent interface.

    Parameters

    • size: number

      Size of point in pixels.

    Returns PointLineAreaSeries

  • Re-specify all values in the data set. This is a convenience method that is fundamentally equal to:

     DataSetXY.clear().appendSamples({ ... })
    

    There are currently no performance differences between using "setSamples" versus "clear + append". However, in future it is possible that setSamples can receive optimizations which would make it recommended over "clear + append". In the mean-time, setSamples is recommended for simplicity and clarity in end user applications.

    For parameters documentation, refer to appendSamples method.

    Returns

    Object itself.

    Parameters

    • arg: {
          colors?: number[] | Uint32Array | Color[];
          count?: number;
          ids?: number[] | Uint32Array;
          lookupValues?: number[] | Float32Array;
          offset?: number;
          offsetColors?: number;
          offsetIds?: number;
          offsetLookupValues?: number;
          offsetRotations?: number;
          offsetSizes?: number;
          rotations?: number[] | Float32Array;
          sizes?: number[] | Float32Array;
          start?: number;
          step?: number;
          xValues?: number[] | TypedArray;
          yValues?: number[] | TypedArray;
      }

      Object with data properties and optional behavior configurations.

      • Optional colors?: number[] | Uint32Array | Color[]
      • Optional count?: number
      • Optional ids?: number[] | Uint32Array
      • Optional lookupValues?: number[] | Float32Array
      • Optional offset?: number
      • Optional offsetColors?: number
      • Optional offsetIds?: number
      • Optional offsetLookupValues?: number
      • Optional offsetRotations?: number
      • Optional offsetSizes?: number
      • Optional rotations?: number[] | Float32Array
      • Optional sizes?: number[] | Float32Array
      • Optional start?: number
      • Optional step?: number
      • Optional xValues?: number[] | TypedArray
      • Optional yValues?: number[] | TypedArray

    Returns PointLineAreaSeries

  • Set stroke style of Series.

    Supported line styles:

     // Example syntax, specify LineStyle
    PointLineAreaSeries.setStrokeStyle(new SolidLine({
    thickness: 2,
    fillStyle: new SolidFill({ color: ColorHEX('#F00') })
    }))
     // Example syntax, change active LineStyle
    PointLineAreaSeries.setStrokeStyle((stroke) => stroke.setThickness(5))

    Use -1 thickness to enable primitive line rendering. Primitive line rendering can have slightly better rendering performance than line with 1 thickness but the quality of line is not as good.

     PointLineAreaSeries.setStrokeStyle((stroke) => stroke.setThickness(-1))
    

    Supported fill styles:

    SolidFill:

    Solid color for entire line series.

     // Example, solid colored line.
    PointLineAreaSeries.setStrokeStyle(new SolidLine({
    thickness: 2,
    fillStyle: new SolidFill({ color: ColorRGBA(255, 0, 0) })
    }))

    To learn more about available Color factories, see ColorRGBA

    PalettedFill:

    Line series supports following look-up modes: x, y and value.

    lookUpProperty: 'x' | 'y':

    Color line stroke dynamically based on x or y coordinate.

     // Example, dynamic color by Y coordinates
    PointLineAreaSeries.setStrokeStyle(new SolidLine({
    thickness: 2,
    fillStyle: new PalettedFill({
    lookUpProperty: 'y',
    lut: new LUT({
    interpolate: true,
    steps: [
    { value: 0, color: ColorRGBA(255, 0, 0) },
    { value: 100, color: ColorRGBA(0, 255, 0) },
    ]
    })
    })
    }))

    To learn more about Color lookup tables, see LUT.

    lookUpProperty: 'value':

    Color line stroke dynamically based on separately supplied value data set. values are specified when adding data points.

     // Example, dynamic color by Value data set
    const series = ChartXY.addPointLineAreaSeries({ lookupValues: true })
    .setStrokeStyle(new SolidLine({
    thickness: 2,
    fillStyle: new PalettedFill({
    lookUpProperty: 'value',
    lut: new LUT({
    interpolate: true,
    steps: [
    { value: 0, color: ColorRGBA(255, 0, 0) },
    { value: 100, color: ColorRGBA(0, 255, 0) },
    ]
    })
    })
    }))
    .appendSamples({
    yValues: [0, 1],
    lookupValues: [0, 100]
    })

    Data point lookup value properties have to be explicitly enabled before they can be used, see lookupValues for more details.

    To learn more about Color lookup tables, see LUT.

    IndividualPointFill:

    Color line stroke with individually picked sample colors. Line segment colors are interpolated between data points.

     // Example, individual colors
    const series = ChartXY.addPointLineAreaSeries({ colors: true })
    .appendSamples({
    yValues: [0, 1],
    colors: [0xff0000ff, 0xff00ff00]
    })
    .setStrokeStyle(new SolidLine({
    thickness: 2,
    fillStyle: new IndividualPointFill()
    }))

    Data point color properties have to be explicitly enabled before they can be used, see colors for more details.

    LinearGradientFill:

    Color line stroke with a linear configurable gradient palette.

     // Example, linear gradient line color
    PointLineAreaSeries.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
    PointLineAreaSeries.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 PointLineAreaSeries

  • Method for solving the nearest data point from a given coordinate on screen.

     // Example usage, from mouse move event.
    ChartXY.onSeriesBackgroundMouseMove((_, event) => {
    const result = LineSeries.solveNearestFromScreen(event)
    })
     // Example usage, arbitrary coordinate on client coordinate system.
    const result = LineSeries.solveNearestFromScreen({ clientX: 100, clientY: 200 })

    Translating coordinates from other coordinate systems is also possible, see translateCoordinate.

    Returns

    undefined or data structure with solve result information that can also be used for positioning custom cursors.

    Parameters

    • location: CoordinateClient

      Location in HTML client coordinates.

    • Optional interpolate: boolean

    Returns undefined | CursorPoint<SampleXY>

  • Solves the nearest data point to a given coordinate on screen.

    Returns

    Undefined or data-structure for positioning of cursors

    Deprecated

    This method signature is deprecated since v4.2.0. Supply CoordinateClient instead.

    Parameters

    • location: Point

      Location on screen

    • Optional interpolate: boolean

    Returns undefined | CursorPoint<SampleXY>