Decimation
The decimation element can be used with line charts to automatically decimate data at the start of the chart life cycle.
Before enabling it, review the requirements to ensure that it will work with the chart you want to create.
The decimation configuration is nested in the chart configuration as following:
// sets the sample at chart level
chart.getOptions().getDecimation().setSamples(1000);
double samples = Dchart.getOptions().getDecimation().getSamples();
The defaults values are set in global defaults options, see default global decimation options.
The following are the attributes that you can set:
Name | Type | Description |
---|---|---|
enabled | boolean | If true , the data decimation is enabled. |
algorithm | DecimationAlgorithm | Decimation algorithm to use. |
samples | double | If the DecimationAlgorithm.LTTB is used, this is the number of samples in the output dataset. Defaults to the canvas width to pick 1 sample per pixel. |
threshold | double | If the number of samples in the current axis range is above this value, the decimation will be triggered. Defaults to 4 times the canvas width. The number of point after decimation can be higher than the threshold value. |
Algorithms
The available decimation algorithms to use for data are the following:
DecimationAlgorithm.MIN_MAX
: it will preserve peaks in your data but could require up to 4 points for each pixel. This type of decimation would work well for a very noisy signal where you need to see data peaks.DecimationAlgorithm.LTTB
(Largest Triangle Three Bucket): it reduces the number of data points significantly. This is most useful for showing trends in data using only a few data points.
Requirements
To use the decimation, the following requirements must be met:
- The dataset must have an IndexAxis of
IndexAxis.X
. - The dataset must be a line.
- The dataset must not need any parsing for instance having
parsing
option set tofalse
. - The X axis for the dataset must be either a linear or time axis.
Filler
Filler element configures the engine which is in charge to manage the filling of the datasets, by the property fill
. See here how filling a dataset.
The filler configuration is nested in the chart configuration as following:
// disables the propagation at chart level
Dchart.getOptions().getFiller().setPropagate(false);
boolean propagate = chart.getOptions().getFiller().isPropagate();
The defaults values are set in global defaults options, see default global filler options.
The following are the attributes that you can set:
Name | Type | Description |
---|---|---|
propagate | boolean | If true , the fill area will be recursively extended to the visible target defined by the fill value of hidden data set targets. |
drawTime | DrawTime | Filler draw time. |