Class NoSelectedDatasetTicksCallback
- java.lang.Object
-
- org.pepstock.charba.client.impl.callbacks.NoSelectedDatasetTicksCallback
-
- All Implemented Interfaces:
TickCallback
public final class NoSelectedDatasetTicksCallback extends Object implements TickCallback
Implementation of tick callback in order to avoid that when all datasets are hidden, the ticks will get a wrong double precision.- Author:
- Andrea "Stock" Stocchero
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_PRECISION
Default precision, 1.
-
Constructor Summary
Constructors Constructor Description NoSelectedDatasetTicksCallback()
Creates the callback using theDEFAULT_PRECISION
.NoSelectedDatasetTicksCallback(int precision)
Creates the callback using the argument as amount of decimals places to apply to ticks.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getPrecision()
Returns the precision applied to ticks.String
onCallback(Axis axis, double value, int index, List<Double> values)
Changes the tick marks to include information about the data type.
-
-
-
Field Detail
-
DEFAULT_PRECISION
public static final int DEFAULT_PRECISION
Default precision, 1.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
NoSelectedDatasetTicksCallback
public NoSelectedDatasetTicksCallback()
Creates the callback using theDEFAULT_PRECISION
.
-
NoSelectedDatasetTicksCallback
public NoSelectedDatasetTicksCallback(int precision)
Creates the callback using the argument as amount of decimals places to apply to ticks.- Parameters:
precision
- amount of decimals places
-
-
Method Detail
-
getPrecision
public int getPrecision()
Returns the precision applied to ticks.- Returns:
- the precision applied to ticks.
-
onCallback
public String onCallback(Axis axis, double value, int index, List<Double> values)
Description copied from interface:TickCallback
Changes the tick marks to include information about the data type.- Specified by:
onCallback
in interfaceTickCallback
- Parameters:
axis
- axis instance where this callback as been definedvalue
- value of tickindex
- index of tickvalues
- list of all tick values- Returns:
- the tick to apply or if the callback returns
null
the associated grid line will be hidden.
It can return aList
of strings (for multiple lines) or a string (for single line).
-
-