public class MeterOptions extends AbstractPieOptions
Modifier and Type | Field and Description |
---|---|
static IsColor |
DEFAULT_DISPLAY_COLOR
Default color of display, rgb(128, 128, 128)
|
static int |
DEFAULT_PRECISION
Default precision 2 to apply displaying the value or percentage.
|
Constructor and Description |
---|
MeterOptions(IsChart chart,
IsDefaultScaledOptions defaultValues)
Builds the object storing the chart instance and defaults.
|
Modifier and Type | Method and Description |
---|---|
IsChart |
getChart()
Returns the chart instance
|
protected T |
getConfiguration()
Returns the configuration element.
|
MeterDisplay |
getDisplay()
Returns the display type of data in chart.
|
IsColor |
getDisplayFontColor()
Returns the font color to apply to the display of value.
|
String |
getFontFamily()
Returns the font family to apply to the display of value.
|
FontStyle |
getFontStyle()
Returns the font style to apply to the display of value.
|
Hover |
getHover()
Returns nothing but throws an exception because not available.
|
Layout |
getLayout()
Returns nothing but throws an exception because not available.
|
Legend |
getLegend()
Returns a legend wrapper where is not possible to display it.
|
int |
getPrecision()
Returns the decimal places to apply to display the value.
|
Tooltips |
getTooltips()
Returns nothing but throws an exception because not available.
|
ValueCallback |
getValueCallback()
Returns the callback to customize the value string into chart.
|
boolean |
isAnimatedDisplay()
Returns if the display will be shown based on the animation of chart.
|
void |
merge(NativeObjectContainer source,
String property)
Merge a native object into this one with a specific property name.
This is used by plugins implementation (native java script ones) when they are not using the standard way to add plugin configuration into options of chart. |
static void |
register(IsChart chart,
org.pepstock.charba.client.configuration.IsEventProvider provider)
Adds the event provider implementation as handlers of chart.
|
void |
setAnimatedDisplay(boolean animatedDisplay)
Sets if the display will be shown based on the animation of chart.
|
void |
setCircumference(double circumference)
Sets the sweep to allow arcs to cover.
|
protected void |
setConfiguration(T configuration) |
void |
setCutoutPercentage(double cutoutPercentage)
Sets the percentage of the chart that is cut out of the middle.
|
void |
setDisplay(MeterDisplay display)
Sets the display type of data in chart.
|
void |
setDisplayFontColor(IsColor displayFontColor)
Sets the font color to apply to the display of value.
|
void |
setFontFamily(String fontFamily)
Sets the font family to apply to the display of value.
|
void |
setFontStyle(FontStyle fontStyle)
Sets the font style to apply to the display of value.
|
void |
setLegendCallback(LegendCallback legendCallback)
Throws an exception because not available.
|
void |
setPrecision(int precision)
Sets the decimal places to apply to display the value.
|
void |
setRotation(double rotation)
Sets the starting angle to draw arcs from.
|
void |
setValueCallback(ValueCallback valueCallback)
Sets the callback to customize the value string into chart.
|
String |
toJSON()
Returns the JSON representation of the object.
|
getCircumference, getCutoutPercentage, getRotation
getAnimation, getAspectRatio, getDevicePixelRatio, getElements, getEvents, getLegendCallback, getPlugins, getResponsiveAnimationDuration, getTitle, hasAxisClickHandlers, hasDatasetSelectionHandlers, hasTitleClickHandlers, isDestroyOnDetach, isDrawOnAttach, isMaintainAspectRatio, isResponsive, load, loadOptions, onAdd, onRemove, setAspectRatio, setDestroyOnDetach, setDevicePixelRatio, setDrawOnAttach, setEvents, setMaintainAspectRatio, setResponsive, setResponsiveAnimationDuration
public static final int DEFAULT_PRECISION
public static final IsColor DEFAULT_DISPLAY_COLOR
public MeterOptions(IsChart chart, IsDefaultScaledOptions defaultValues)
chart
- chart instancedefaultValues
- defaults of chartpublic final void setCutoutPercentage(double cutoutPercentage)
AbstractPieOptions
setCutoutPercentage
in class AbstractPieOptions
cutoutPercentage
- the percentage of the chart that is cut out of the middle.public final void setRotation(double rotation)
AbstractPieOptions
setRotation
in class AbstractPieOptions
rotation
- starting angle to draw arcs from.public final void setCircumference(double circumference)
AbstractPieOptions
setCircumference
in class AbstractPieOptions
circumference
- the sweep to allow arcs to cover.public final Hover getHover()
getHover
in class ConfigurationOptions
public final Layout getLayout()
getLayout
in class ConfigurationOptions
public final Legend getLegend()
getLegend
in class ConfigurationOptions
public final Tooltips getTooltips()
getTooltips
in class ConfigurationOptions
public final void setLegendCallback(LegendCallback legendCallback)
setLegendCallback
in class ConfigurationOptions
legendCallback
- ignored because will throw an exceptionpublic final MeterDisplay getDisplay()
public final void setDisplay(MeterDisplay display)
display
- the display to setpublic final int getPrecision()
public final void setPrecision(int precision)
precision
- the decimal places to apply to the value in chartpublic final String getFontFamily()
public final void setFontFamily(String fontFamily)
fontFamily
- the fontFamily to setpublic final FontStyle getFontStyle()
public final void setFontStyle(FontStyle fontStyle)
fontStyle
- the fontStyle to setpublic final IsColor getDisplayFontColor()
public final void setDisplayFontColor(IsColor displayFontColor)
displayFontColor
- the displayFontColor to setpublic final boolean isAnimatedDisplay()
true
if animated, otherwise false
. Default is false
.public final void setAnimatedDisplay(boolean animatedDisplay)
animatedDisplay
- the animatedDisplay to set, true
if animated, otherwise false
public final ValueCallback getValueCallback()
public final void setValueCallback(ValueCallback valueCallback)
valueCallback
- the callback to customize the value string into chartpublic static void register(IsChart chart, org.pepstock.charba.client.configuration.IsEventProvider provider)
chart
- chart instanceprovider
- event provider implmentationprotected final void setConfiguration(T configuration)
configuration
- the configuration to setprotected final T getConfiguration()
public final void merge(NativeObjectContainer source, String property)
source
- native object container to addproperty
- property namepublic final String toJSON()
public final IsChart getChart()