Class MeterChart
- java.lang.Object
-
- org.pepstock.charba.client.events.HandlerManager
-
- org.pepstock.charba.client.AbstractChart
-
- org.pepstock.charba.client.impl.charts.MeterChart
-
- All Implemented Interfaces:
HasAxes
,IsChart
,IsDatasetCreator<MeterDataset>
public final class MeterChart extends AbstractChart
METER chart implementation.- Author:
- Andrea "Stock" Stocchero
-
-
Field Summary
Fields Modifier and Type Field Description static ControllerType
CONTROLLER_TYPE
METER controller typestatic double
DEFAULT_MAX
Default of maximum value of data in the a dataset (percentage based), 100.0.static String
TYPE
Name of chart type "charbameter" for meter-
Fields inherited from class org.pepstock.charba.client.AbstractChart
datasetReferenceFactory
-
-
Constructor Summary
Constructors Constructor Description MeterChart()
Builds the object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
applyConfiguration()
Called before any drawing or reconfiguration in order that the chart which implements it can override optionsprotected boolean
checkDataset(Dataset dataset)
Returnstrue
if the dataset can be managed by a this chart type.protected int
getMaximumDatasetsCount()
Returns the maximum amount of datasets that the chart can manage.MeterOptions
getOptions()
Returns the options of chart.MeterDataset
newDataset(boolean hidden)
Creates a new dataset related to chart type.MeterDataset
newDataset(double max)
Returns a data set with a maximum value.static void
register()
Registers the METER controller in CHART.JS.-
Methods inherited from class org.pepstock.charba.client.AbstractChart
addHandler, checkAxes, checkDatasets, clear, createAndSetTimer, destroy, draw, getActiveElements, getBaseType, getCanvas, getChartElement, getData, getDatasetAtEvent, getDatasetItem, getDatasetReferenceFactory, getDefaultChartOptions, getDrawCount, getElementAtEvent, getElementAtEvent, getElementsAtEvent, getElementsAtEvent, getId, getInitialCursor, getMaximumAxesCount, getNode, getPlugins, getSource, getTimer, getTooltipActiveElements, getType, getVisibleDatasetCount, getWholeOptions, hide, hide, isChartAttached, isDatasetVisible, isDataVisible, isDestroyOnDetach, isDrawOnAttach, isInitialized, isPluginEnabled, onAttach, onDetach, reconfigure, reconfigure, reconfigure, removeCanvasPreventDefault, render, reset, resetActiveElements, resetTooltipActiveElements, resize, resize, setActiveElements, setActiveElements, setDatasetVisibility, setDestroyOnDetach, setDrawOnAttach, setTooltipActiveElements, setTooltipActiveElements, setTooltipActiveElements, setTooltipActiveElements, show, show, stop, toBase64Image, toggleDataVisibility, update, update, update
-
Methods inherited from class org.pepstock.charba.client.events.HandlerManager
fireEvent, getHandlerCount, isEventHandled
-
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.IsChart
fireEvent, getHandlerCount, isEventHandled, toBase64Image, toBase64Image, toBase64Image
-
Methods inherited from interface org.pepstock.charba.client.IsDatasetCreator
newDataset
-
-
-
-
Field Detail
-
TYPE
public static final String TYPE
Name of chart type "charbameter" for meter- See Also:
- Constant Field Values
-
CONTROLLER_TYPE
public static final ControllerType CONTROLLER_TYPE
METER controller type
-
DEFAULT_MAX
public static final double DEFAULT_MAX
Default of maximum value of data in the a dataset (percentage based), 100.0.- See Also:
- Constant Field Values
-
-
Method Detail
-
getOptions
public MeterOptions getOptions()
Description copied from interface:IsChart
Returns the options of chart.- Returns:
- the options of chart.
-
newDataset
public MeterDataset newDataset(boolean hidden)
Description copied from interface:IsDatasetCreator
Creates a new dataset related to chart type.- Parameters:
hidden
- iftrue
, it will be initially hidden.- Returns:
- a new dataset related to chart type.
-
newDataset
public MeterDataset newDataset(double max)
Returns a data set with a maximum value.- Parameters:
max
- maximum value of data set- Returns:
- data set instance
-
checkDataset
protected boolean checkDataset(Dataset dataset)
Description copied from class:AbstractChart
Returnstrue
if the dataset can be managed by a this chart type.- Specified by:
checkDataset
in classAbstractChart
- Parameters:
dataset
- dataset to check- Returns:
true
if the dataset can be managed by a this chart type
-
register
public static void register()
Registers the METER controller in CHART.JS.
-
applyConfiguration
protected final void applyConfiguration()
Description copied from class:AbstractChart
Called before any drawing or reconfiguration in order that the chart which implements it can override options- Overrides:
applyConfiguration
in classAbstractChart
-
getMaximumDatasetsCount
protected final int getMaximumDatasetsCount()
Description copied from class:AbstractChart
Returns the maximum amount of datasets that the chart can manage.- Overrides:
getMaximumDatasetsCount
in classAbstractChart
- Returns:
- the maximum amount of datasets that the chart can manage.
-
-