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 Threshold
getCurrent()
Returns the current threshold.List<Threshold>
getThresholds()
Gets all thresholds by an unmodifiable list.boolean
isPercentageThreshold()
Returnstrue
if percentage threshold is used, otherwisefalse
.void
setColor(String valueColor)
Sets the fill color for value.void
setColor(IsColor valueColor)
Sets the fill color for value.void
setPercentageThreshold(boolean percentageThreshold)
Setstrue
if percentage threshold is used, otherwisefalse
.void
setThresholds(Threshold... newThresholds)
Sets all thresholds to use for this gauge.void
setValue(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, retrieveRoot, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setElementAndAddToParent, setInternalCallbackToModel, setInternalCallbackToModel, 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
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, 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, 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:MeterDataset
Sets the fill color for value.- Overrides:
setColor
in classMeterDataset
- Parameters:
valueColor
- the fill color for value.
-
setColor
public void setColor(String valueColor)
Description copied from class:MeterDataset
Sets the fill color for value.- Overrides:
setColor
in classMeterDataset
- Parameters:
valueColor
- the fill color for value.
-
getCurrent
public Threshold getCurrent()
Returns the current threshold.- Returns:
- the current
-
isPercentageThreshold
public boolean isPercentageThreshold()
Returnstrue
if percentage threshold is used, otherwisefalse
.- Returns:
true
if percentage threshold is used, otherwisefalse
-
setPercentageThreshold
public void setPercentageThreshold(boolean percentageThreshold)
Setstrue
if percentage threshold is used, otherwisefalse
.- Parameters:
percentageThreshold
-true
if 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:
setValue
in classMeterDataset
- Parameters:
value
- the value to set
-
-