Class MeterDataset
- 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
-
- All Implemented Interfaces:
HasCallbackScope,HasDataset,IsDefaultAnimationContainer,IsDefaultAnimationTransition,HasAnimationOptions
- Direct Known Subclasses:
GaugeDataset
public class MeterDataset extends Dataset
The Meter chart allows a number of properties to be specified for each dataset. These are used to set display properties for a specific dataset.
The minimum value of data is 0 (seeMINIMUM_VALUE).
The dataset will have always 2 data and setting the color of data, the first is the value color and the second is the empty one.
To set the data, is mandatory to usesetValue(double)) method.- 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 Modifier and Type Field Description static IsColorDEFAULT_EMPTY_VALUE_COLORDefault empty color, rgb(234, 234, 234).static doubleDEFAULT_MAXIMUM_VALUEDefault maximum value is 100.0.static IsColorDEFAULT_VALUE_COLORDefault value color, rgb(140, 214, 16).static doubleMINIMUM_VALUEMinimum value is 0.0.-
Fields inherited from class org.pepstock.charba.client.data.Dataset
DEFAULT_HIDDEN, DEFAULT_NORMALIZED, DEFAULT_PARSING
-
-
Constructor Summary
Constructors Modifier Constructor Description MeterDataset(double max)Creates a dataset setting the maximum value of dataset.MeterDataset(double max, IsDefaultOptions defaultValues)Creates a dataset setting the maximum value of dataset and defaults value.protectedMeterDataset(ControllerType type, double max, IsDefaultOptions defaultValues)Creates a dataset setting the maximum value of dataset and defaults value and the controller type in case of extension
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IsColorgetBorderColor()Returns the color of the arc border.StringgetBorderColorAsString()Returns the color of the arc border, as string.intgetBorderRadius()Returns the arc border radius (in pixels).ArcBorderRadiusgetBorderRadiusAsObject()Returns the arc border radius, as object.intgetBorderWidth()Returns the width of the arc border.IsColorgetColor()Returns the fill color for value.StringgetColorAsString()Returns the fill color for value.DescriptionLabelgetDescriptionLabel()Returns the description element of meter chart.IsColorgetEmptyColor()Returns the fill color for empty sector.StringgetEmptyColorAsString()Returns the fill color for empty sector.doublegetMax()Returns the maximum value of chart.doublegetValue()Returns the value of the chart.ValueLabelgetValueLabel()Returns the value element of meter chart.voidsetBackgroundColor(ColorCallback<DatasetContext> backgroundColorCallback)Sets the background color callback.voidsetBackgroundColor(NativeCallback backgroundColorCallback)Sets the background color callback.voidsetBorderColor(String borderColor)Sets the color of the arc border.voidsetBorderColor(ColorCallback<DatasetContext> borderColorCallback)Sets the border color callback.voidsetBorderColor(NativeCallback borderColorCallback)Sets the border color callback.voidsetBorderColor(IsColor borderColor)Sets the color of the arc border.voidsetBorderRadius(int borderRadius)Sets the arc border radius (in pixels).voidsetBorderRadius(ArcBorderRadius borderRadius)Sets the arc border radius (in pixels).voidsetBorderWidth(int borderWidth)Sets the width of the arc border.voidsetColor(String valueColor)Sets the fill color for value.voidsetColor(IsColor valueColor)Sets the fill color for value.voidsetData(double... values)Throws an exception because not available.voidsetData(List<Double> values)Throws an exception because not available.voidsetEmptyColor(String emptyValueColor)Sets the fill color for empty sector.voidsetEmptyColor(IsColor emptyValueColor)Sets the fill color for empty sector.voidsetHoverBackgroundColor(ColorCallback<DatasetContext> hoverBackgroundColorCallback)Sets the hover background color callback.voidsetHoverBackgroundColor(NativeCallback hoverBackgroundColorCallback)Sets the hover background color callback.voidsetHoverBorderColor(ColorCallback<DatasetContext> hoverBorderColorCallback)Sets the hover border color callback.voidsetHoverBorderColor(NativeCallback hoverBorderColorCallback)Sets the hover border color callback.voidsetValue(double value)-
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
-
-
-
-
Field Detail
-
DEFAULT_VALUE_COLOR
public static final IsColor DEFAULT_VALUE_COLOR
Default value color, rgb(140, 214, 16).
-
DEFAULT_EMPTY_VALUE_COLOR
public static final IsColor DEFAULT_EMPTY_VALUE_COLOR
Default empty color, rgb(234, 234, 234).
-
DEFAULT_MAXIMUM_VALUE
public static final double DEFAULT_MAXIMUM_VALUE
Default maximum value is 100.0.- See Also:
- Constant Field Values
-
MINIMUM_VALUE
public static final double MINIMUM_VALUE
Minimum value is 0.0.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MeterDataset
public MeterDataset(double max)
Creates a dataset setting the maximum value of dataset. It uses the global options has default.- Parameters:
max- maximum value of dataset.
-
MeterDataset
public MeterDataset(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
-
MeterDataset
protected MeterDataset(ControllerType type, double max, IsDefaultOptions defaultValues)
Creates a dataset setting the maximum value of dataset and defaults value and the controller type in case of extension- Parameters:
type- controller type related to the datasetmax- maximum value of dataset.defaultValues- default options
-
-
Method Detail
-
getValueLabel
public final ValueLabel getValueLabel()
Returns the value element of meter chart.- Returns:
- the value element of meter chart
-
getDescriptionLabel
public final DescriptionLabel getDescriptionLabel()
Returns the description element of meter chart.- Returns:
- the description element of meter chart
-
setColor
public void setColor(IsColor valueColor)
Sets the fill color for value.- Parameters:
valueColor- the fill color for value.
-
setColor
public void setColor(String valueColor)
Sets the fill color for value.- Parameters:
valueColor- the fill color for value.
-
getColorAsString
public String getColorAsString()
Returns the fill color for value.- Returns:
- the fill color for value.
-
getColor
public IsColor getColor()
Returns the fill color for value.- Returns:
- the fill color for value.
-
setEmptyColor
public void setEmptyColor(IsColor emptyValueColor)
Sets the fill color for empty sector.- Parameters:
emptyValueColor- the fill color for empty sector.
-
setEmptyColor
public void setEmptyColor(String emptyValueColor)
Sets the fill color for empty sector.- Parameters:
emptyValueColor- the fill color for empty sector.
-
getEmptyColorAsString
public String getEmptyColorAsString()
Returns the fill color for empty sector.- Returns:
- the fill color for empty sector.
-
getEmptyColor
public IsColor getEmptyColor()
Returns the fill color for empty sector.- Returns:
- the fill color for empty sector.
-
getMax
public final double getMax()
Returns the maximum value of chart.- Returns:
- the max
-
getValue
public final double getValue()
Returns the value of the chart.- Returns:
- the value
-
setValue
public void setValue(double value)
- Parameters:
value- the value to set
-
setBorderColor
public void setBorderColor(IsColor borderColor)
Sets the color of the arc border.- Parameters:
borderColor- the color of the arc border
-
setBorderColor
public void setBorderColor(String borderColor)
Sets the color of the arc border.- Parameters:
borderColor- the color of the arc border
-
getBorderColorAsString
public String getBorderColorAsString()
Returns the color of the arc border, as string.- Returns:
- the color of the arc border.
-
getBorderColor
public IsColor getBorderColor()
Returns the color of the arc border.- Returns:
- the color of the arc border
-
setBorderWidth
public void setBorderWidth(int borderWidth)
Sets the width of the arc border.- Parameters:
borderWidth- the width of the arc border.
-
getBorderWidth
public int getBorderWidth()
Returns the width of the arc border.- Returns:
- the width of the arc border.
-
setBorderRadius
public void setBorderRadius(int borderRadius)
Sets the arc border radius (in pixels).- Parameters:
borderRadius- the arc border radius (in pixels).
-
setBorderRadius
public void setBorderRadius(ArcBorderRadius borderRadius)
Sets the arc border radius (in pixels).- Parameters:
borderRadius- the arc border radius (in pixels).
-
getBorderRadius
public int getBorderRadius()
Returns the arc border radius (in pixels).- Returns:
- the arc border radius (in pixels).
-
getBorderRadiusAsObject
public ArcBorderRadius getBorderRadiusAsObject()
Returns the arc border radius, as object.- Returns:
- the arc border radius, as object
-
setData
public final void setData(double... values)
Throws an exception because not available.
-
setBackgroundColor
public void setBackgroundColor(ColorCallback<DatasetContext> backgroundColorCallback)
Description copied from class:DatasetSets the background color callback.- Overrides:
setBackgroundColorin classDataset- Parameters:
backgroundColorCallback- the background color callback.
-
setBackgroundColor
public void setBackgroundColor(NativeCallback backgroundColorCallback)
Description copied from class:DatasetSets the background color callback.- Overrides:
setBackgroundColorin classDataset- Parameters:
backgroundColorCallback- the background color callback.
-
setHoverBackgroundColor
public void setHoverBackgroundColor(ColorCallback<DatasetContext> hoverBackgroundColorCallback)
Description copied from class:DatasetSets the hover background color callback.- Overrides:
setHoverBackgroundColorin classDataset- Parameters:
hoverBackgroundColorCallback- the hover background color callback.
-
setHoverBackgroundColor
public void setHoverBackgroundColor(NativeCallback hoverBackgroundColorCallback)
Description copied from class:DatasetSets the hover background color callback.- Overrides:
setHoverBackgroundColorin classDataset- Parameters:
hoverBackgroundColorCallback- the hover background color callback.
-
setBorderColor
public void setBorderColor(ColorCallback<DatasetContext> borderColorCallback)
Description copied from class:DatasetSets the border color callback.- Overrides:
setBorderColorin classDataset- Parameters:
borderColorCallback- the border color callback.
-
setBorderColor
public void setBorderColor(NativeCallback borderColorCallback)
Description copied from class:DatasetSets the border color callback.- Overrides:
setBorderColorin classDataset- Parameters:
borderColorCallback- the border color callback.
-
setHoverBorderColor
public void setHoverBorderColor(ColorCallback<DatasetContext> hoverBorderColorCallback)
Description copied from class:DatasetSets the hover border color callback.- Overrides:
setHoverBorderColorin classDataset- Parameters:
hoverBorderColorCallback- the hover border color callback.
-
setHoverBorderColor
public void setHoverBorderColor(NativeCallback hoverBorderColorCallback)
Description copied from class:DatasetSets the hover border color callback.- Overrides:
setHoverBorderColorin classDataset- Parameters:
hoverBorderColorCallback- the hover border color callback.
-
-