Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface DataPattern

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

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, 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
     }
 })
 // Example 2, 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
     }
 })

Index

Properties

Optional allowDataGrouping

allowDataGrouping : undefined | false | true

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

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.

Optional regularProgressiveStep

regularProgressiveStep : undefined | false | true

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.

This mode is heavily optimized - use it whenever you can.

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.