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

It is strongly recommended to utilize data patterns whenever possible. The resulting performance can be 10 or even 100 times better when compared to not using data patterns.

When using this flag, it is the users responsibility to ensure that the supplied data abides by the promised pattern. Invalid input data can result in rendering artifacts or data not being rendered.

Example usage:

 // Example 1, Line Chart with timestamp X values that come directly from a sensor and have some randomness.
// => 'ProgressiveX' can be used
ChartXY.addLineSeries({
dataPattern: {
// pattern: 'ProgressiveX' => Each consecutive data point has increased X coordinate.
pattern: 'ProgressiveX',
// regularProgressiveStep: false => The X step between each consecutive data point is not regular.
regularProgressiveStep: false
}
})
 // Example 2, 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
}
})

Hierarchy

  • DataPattern

Properties

allowDataGrouping?: boolean

Optional flag that can be used to disable automatic grouping of progressive data that is packed very tightly together.

Even if data grouping is enabled, data will be automatically displayed according to the active zoom level so that the data looks accurate at all times.

Set to true or omit for maximum performance.

pattern: "ProgressiveX" | "ProgressiveY" | "RegressiveX" | "RegressiveY"

Data pattern selection from a collection of preset options.

'ProgressiveX' = every data points X value is higher than the previous ones X value.

'ProgressiveY' = every data points Y value is higher than the previous ones Y value.

'RegressiveX' = every data points X value is lower than the previous ones X value.

'RegressiveY' = every data points X value is lower than the previous ones Y value.

regularProgressiveStep?: boolean

Optional flag that can be used to indicate that the input data points will always progress by a static amount. This is used in conjuction with a Progressive or Regressive pattern.

For example, if pattern: 'ProgressiveX', and the step between two consecutive data points is always X = 1, then this can be set to regularProgressiveStep: true.

Enabling the regularProgressiveStep option when eligible can lead to increased performance, but it is not a very significant difference.

When enabled, invalid input data can result in rendering artifacts or data not being rendered. If you see rendering errors, try setting this to false, or make sure that your data is indeed "regular progressive":

  • For pattern: 'ProgressiveX' or 'RegressiveX', ensure that X step between each data point is always the same.
  • For pattern: 'ProgressiveY' or 'RegressiveY', ensure that Y step between each data point is always the same.