Class GaugeDataset
- java.lang.Object
-
- org.pepstock.charba.client.commons.NativeObjectContainer
-
- org.pepstock.charba.client.commons.AbstractNode
-
- org.pepstock.charba.client.data.Dataset
-
- org.pepstock.charba.client.impl.charts.MeterDataset
-
- org.pepstock.charba.client.impl.charts.GaugeDataset
-
- All Implemented Interfaces:
HasCallbackScope,HasDataset,IsDefaultAnimationContainer,IsDefaultAnimationTransition,HasAnimationOptions
public final class GaugeDataset extends MeterDataset
The Gauge chart allows a number of properties to be specified for each dataset. These are used to set display properties for a specific dataset.
Is equals of Meter dataset.
The minimum value of data is 0 (seeMeterDataset.MINIMUM_VALUE).
To set the data, is mandatory to useMeterDataset.setValue(double)) method instead ofDataset.setData(double...)) one.- Author:
- Andrea "Stock" Stocchero
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.pepstock.charba.client.data.Dataset
Dataset.CanvasObjectProperty, Dataset.CommonProperty
-
-
Field Summary
-
Fields inherited from class org.pepstock.charba.client.impl.charts.MeterDataset
DEFAULT_EMPTY_VALUE_COLOR, DEFAULT_MAXIMUM_VALUE, DEFAULT_VALUE_COLOR, MINIMUM_VALUE
-
Fields inherited from class org.pepstock.charba.client.data.Dataset
DEFAULT_HIDDEN, DEFAULT_NORMALIZED, DEFAULT_PARSING
-
-
Constructor Summary
Constructors Constructor Description GaugeDataset(double max)Creates a dataset for gauge with maximum value of data.GaugeDataset(double max, IsDefaultOptions defaultValues)Creates a dataset setting the maximum value of dataset and defaults value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ThresholdgetCurrent()Returns the current threshold.List<Threshold>getThresholds()Gets all thresholds by an unmodifiable list.booleanisPercentageThreshold()Returnstrueif percentage threshold is used, otherwisefalse.voidsetColor(String valueColor)Sets the fill color for value.voidsetColor(IsColor valueColor)Sets the fill color for value.voidsetMax(double max)Sets the maximum value of chart.voidsetPercentageThreshold(boolean percentageThreshold)Setstrueif percentage threshold is used, otherwisefalse.voidsetThresholds(Threshold... newThresholds)Sets all thresholds to use for this gauge.voidsetValue(double value)-
Methods inherited from class org.pepstock.charba.client.impl.charts.MeterDataset
getBorderColor, getBorderColorAsString, getBorderRadius, getBorderRadiusAsObject, getBorderWidth, getColor, getColorAsString, getDescriptionLabel, getEmptyColor, getEmptyColorAsString, getMax, getValue, getValueLabel, setBackgroundColor, setBackgroundColor, setBorderColor, setBorderColor, setBorderColor, setBorderColor, setBorderRadius, setBorderRadius, setBorderWidth, setData, setData, setEmptyColor, setEmptyColor, setHoverBackgroundColor, setHoverBackgroundColor, setHoverBorderColor, setHoverBorderColor
-
Methods inherited from class org.pepstock.charba.client.data.Dataset
createContext, getAnimationContainer, getBackgroundColorCallback, getBorderColorCallback, getClip, getClipAsObject, getData, getData, getDataCount, getDataset, getDataType, getDefaultBackgroundColorAsString, getDefaultBorderColorAsString, getDefaultBorderWidth, getDefaultHoverBackgroundColorAsString, getDefaultHoverBorderColorAsString, getDefaultHoverBorderWidth, getDefaultValues, getHoverBackgroundColorCallback, getHoverBorderColorCallback, getId, getLabel, getOptions, getOptions, getScope, getType, getTypedDataset, hasOptions, invokeColorCallback, isClip, isHidden, isNormalized, isParsing, removeOptions, setClip, setClip, setClip, setHidden, setLabel, setNormalized, setOptions, setOptions, setParsing
-
Methods inherited from class org.pepstock.charba.client.commons.AbstractNode
checkAndAddToParent, getChildKey, getParentNode, getRootNode, getUpdateListener, retrieveRoot, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setElementAndAddToParent, setInternalCallbackToModel, setInternalCallbackToModel, setUpdateListener, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent
-
Methods inherited from class org.pepstock.charba.client.commons.NativeObjectContainer
checkAndGetColor, checkDefaultValuesArgument, empty, getArrayValue, getElement, getIncrementalId, getNativeChart, getNativeEvent, getNativeObject, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValueForMultipleKeyTypes, getValueForMultipleKeyTypes, getValueForMultipleKeyTypes, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, has, has, isType, keys, loadNativeObject, remove, remove, setArrayValue, setArrayValue, setArrayValue, setElement, setEmptyValue, setNewIncrementalId, setNewIncrementalId, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, toJSON, type
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.pepstock.charba.client.options.HasAnimationOptions
getAnimation, getAnimations, getTransitions, isAnimationEnabled, setAnimationEnabled
-
-
-
-
Constructor Detail
-
GaugeDataset
public GaugeDataset(double max)
Creates a dataset for gauge with maximum value of data. It uses the global options has default.- Parameters:
max- maximum value of data.
-
GaugeDataset
public GaugeDataset(double max, IsDefaultOptions defaultValues)Creates a dataset setting the maximum value of dataset and defaults value.- Parameters:
max- maximum value of dataset.defaultValues- default options
-
-
Method Detail
-
setColor
public void setColor(IsColor valueColor)
Description copied from class:MeterDatasetSets the fill color for value.- Overrides:
setColorin classMeterDataset- Parameters:
valueColor- the fill color for value.
-
setColor
public void setColor(String valueColor)
Description copied from class:MeterDatasetSets the fill color for value.- Overrides:
setColorin classMeterDataset- Parameters:
valueColor- the fill color for value.
-
setMax
public void setMax(double max)
Description copied from class:MeterDatasetSets the maximum value of chart.- Overrides:
setMaxin classMeterDataset- Parameters:
max- the maximum value of chart.
-
getCurrent
public Threshold getCurrent()
Returns the current threshold.- Returns:
- the current
-
isPercentageThreshold
public boolean isPercentageThreshold()
Returnstrueif percentage threshold is used, otherwisefalse.- Returns:
trueif percentage threshold is used, otherwisefalse
-
setPercentageThreshold
public void setPercentageThreshold(boolean percentageThreshold)
Setstrueif percentage threshold is used, otherwisefalse.- Parameters:
percentageThreshold-trueif percentage threshold is used, otherwisefalse
-
setThresholds
public void setThresholds(Threshold... newThresholds)
Sets all thresholds to use for this gauge.- Parameters:
newThresholds- thresholds array.
-
getThresholds
public List<Threshold> getThresholds()
Gets all thresholds by an unmodifiable list.- Returns:
- all thresholds by an unmodifiable list
-
setValue
public void setValue(double value)
- Overrides:
setValuein classMeterDataset- Parameters:
value- the value to set
-
-