Class DefaultChartDecimation
- java.lang.Object
-
- org.pepstock.charba.client.defaults.chart.DefaultChartDecimation
-
- All Implemented Interfaces:
IsDefaultDecimation
public final class DefaultChartDecimation extends Object implements IsDefaultDecimation
Defaults for decimation plugin option element, based on chart type.- Author:
- Andrea "Stock" Stocchero
-
-
Constructor Summary
Constructors Constructor Description DefaultChartDecimation(IsDefaultDecimation decimation)
Creates the object by decimation plugin option element instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DecimationAlgorithm
getAlgorithm()
Returns the algorithm used by the plugin.double
getSamples()
If theDecimationAlgorithm.LTTB
algorithm is used, this is the number of samples in the output data set.
Defaults to the canvas width to pick 1 sample per pixel.double
getThreshold()
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.boolean
isEnabled()
Returnstrue
if decimation are enabled.
-
-
-
Constructor Detail
-
DefaultChartDecimation
public DefaultChartDecimation(IsDefaultDecimation decimation)
Creates the object by decimation plugin option element instance.- Parameters:
decimation
- decimation plugin option element instance.
-
-
Method Detail
-
isEnabled
public boolean isEnabled()
Description copied from interface:IsDefaultDecimation
Returnstrue
if decimation are enabled.- Specified by:
isEnabled
in interfaceIsDefaultDecimation
- Returns:
true
if decimation are enabled.
-
getAlgorithm
public DecimationAlgorithm getAlgorithm()
Description copied from interface:IsDefaultDecimation
Returns the algorithm used by the plugin.- Specified by:
getAlgorithm
in interfaceIsDefaultDecimation
- Returns:
- the algorithm used by the plugin
-
getSamples
public double getSamples()
Description copied from interface:IsDefaultDecimation
If theDecimationAlgorithm.LTTB
algorithm is used, this is the number of samples in the output data set.
Defaults to the canvas width to pick 1 sample per pixel.- Specified by:
getSamples
in interfaceIsDefaultDecimation
- Returns:
- the number of samples in the output data set
-
getThreshold
public double getThreshold()
Description copied from interface:IsDefaultDecimation
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.- Specified by:
getThreshold
in interfaceIsDefaultDecimation
- Returns:
- the number of samples in the current axis range is above this value, the decimation will be triggered
-
-