Interface for readonly configuration of LineSeries.

Commonly used properties:

  • xAxis: Attach series on non-default X Axis.
  • yAxis: Attach series on non-default Y Axis.
  • dataPattern: Enable powerful application specific optimizations if input data follows a specific pattern.

Example usage:

 // Example 1, create series with default configuration.
const series = ChartXY.addLineSeries({})
 // Example 2, attach series to non-default X Axis.
const series = ChartXY.addLineSeries({
xAxis: myNonDefaultAxisX
})
 // Example 3, specify progressive X data pattern for enabling application specific optimizations.
const series = ChartXY.addLineSeries({
dataPattern: {
// pattern: 'ProgressiveX' => Each consecutive data point has increased X coordinate.
pattern: 'ProgressiveX',
// regularProgressiveStep: true => The X step between each consecutive data point is regular (for example, always `1.0`).
regularProgressiveStep: true,
}
})

See also addLineSeries.

Hierarchy

Properties

automaticColorIndex?: number

Optional index to use for automatic coloring of series.

Normally series are automatically colored differently when you create several series in the same chart. However, in some cases you might want to alter this order of automatic coloring, or use the automatic color palettes on series that belong to different charts.

In these scenarios you can use automaticColorIndex to tell each series individually what is its place in the default color palette.

 // Create series using the first color in default Theme palette.
const series1 = chart.addLineSeries({ automaticColorIndex: 0 })
// Create another series colored with the 3rd color.
const series2 = chart.addLineSeries({ automaticColorIndex: 2 })
dataPattern?: DataPattern

Interface for enabling powerful application specific optimizations if input data follows a specific pattern.

See DataPattern to learn if your data is eligible for such optimizations.

Example usage:

 // Example, Line Chart with timestamp X values that always progress by exactly 1 minute (60000 ms).
// => 'ProgressiveX' + regularProgressiveStep can be used
ChartXY.addLineSeries({
dataPattern: {
// pattern: 'ProgressiveX' => Each consecutive data point has increased X coordinate.
pattern: 'ProgressiveX',
// regularProgressiveStep: true => The X step between each consecutive data point is regular (for example, always `1.0`).
regularProgressiveStep: true,
}
})
individualLookupValuesEnabled?: boolean

Flag that can be used to enable data points value property on top of x and y. By default this is disabled.

This feature can be used to color data points individually by dynamic color look up.

If required, this must be enabled when the series is created.

 // Example, enable LineSeries data `value` property.
const lineSeries = chart.addLineSeries({
individualLookupValuesEnabled: true
})

// 'value' property can now be included in data points.
lineSeries.add([
{ x: 0, y: 0, z: 0, value: 5 }
])

individualLookupValuesEnabled must be enabled in order to style LineSeries with PalettedFill of lookUpProperty: 'value'.

 // Example, enable line coloring based on `value` property.
lineSeries.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) },
]
})
})
}))
xAxis?: Axis

Optional non-default X Axis to attach series to.

By default, series are attached to the same X Axis, that is returned by getDefaultAxisX.

yAxis?: Axis

Optional non-default Y Axis to attach series to.

By default, series are attached to the same Y Axis, that is returned by getDefaultAxisY.