Package org.pepstock.charba.client
Class BarChart
- java.lang.Object
-
- org.pepstock.charba.client.events.HandlerManager
-
- org.pepstock.charba.client.AbstractChart
-
- org.pepstock.charba.client.BarChart
-
- All Implemented Interfaces:
HasAxes
,HasCartesianAxes
,IsChart
,IsDatasetCreator<BarDataset>
- Direct Known Subclasses:
HorizontalBarChart
public class BarChart extends AbstractChart implements IsDatasetCreator<BarDataset>, HasCartesianAxes
BAR chart implementation.
A bar chart provides a way of showing data values represented as vertical bars.
It is sometimes used to show trend data, and the comparison of multiple data sets side by side.- Author:
- Andrea "Stock" Stocchero
-
-
Constructor Summary
Constructors Modifier Constructor Description BarChart()
Builds the object.protected
BarChart(Type extendedType)
Builds the chart.
This is must be extended for controller which are based on this type of chart.protected
BarChart(Type extendedType, boolean doNotCreateOptions)
Builds the chart.
This is must be extended for controller which are based on this type of chart.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
checkDataset(Dataset dataset)
Returnstrue
if the dataset can be managed by a this chart type.BarOptions
getOptions()
Returns the options of chart.BarDataset
newDataset(boolean hidden)
Creates a new dataset related to chart type.-
Methods inherited from class org.pepstock.charba.client.AbstractChart
addHandler, applyConfiguration, checkAxes, checkDatasets, clear, createAndSetTimer, destroy, draw, getActiveElements, getBaseType, getCanvas, getChartElement, getData, getDatasetAtEvent, getDatasetItem, getDefaultChartOptions, getElementAtEvent, getElementsAtEvent, getId, getInitialCursor, getMaximumAxesCount, getMaximumDatasetsCount, getNode, getPlugins, getSource, getTimer, getTooltipActiveElements, getType, getVisibleDatasetCount, getWholeOptions, hide, hide, isChartAttached, isDatasetVisible, isDataVisible, isDestroyOnDetach, isDrawOnAttach, isInitialized, onAttach, onDetach, reconfigure, reconfigure, reconfigure, removeCanvasPreventDefault, render, reset, resetActiveElements, resetTooltipActiveElements, resize, resize, setActiveElements, setActiveElements, setDatasetVisibility, setDestroyOnDetach, setDrawOnAttach, 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.HasCartesianAxes
checkAxis
-
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
-
-
-
-
Constructor Detail
-
BarChart
public BarChart()
Builds the object.
-
BarChart
protected BarChart(Type extendedType)
Builds the chart.
This is must be extended for controller which are based on this type of chart.- Parameters:
extendedType
- type of chart
-
BarChart
protected BarChart(Type extendedType, boolean doNotCreateOptions)
Builds the chart.
This is must be extended for controller which are based on this type of chart.- Parameters:
extendedType
- type of chartdoNotCreateOptions
- iftrue
, it ignores the creation of the bar options because the extended class will create own options.
-
-
Method Detail
-
getOptions
public BarOptions getOptions()
Description copied from interface:IsChart
Returns the options of chart.- Specified by:
getOptions
in interfaceIsChart
- Returns:
- the options of chart.
-
newDataset
public BarDataset newDataset(boolean hidden)
Description copied from interface:IsDatasetCreator
Creates a new dataset related to chart type.- Specified by:
newDataset
in interfaceIsDatasetCreator<BarDataset>
- Parameters:
hidden
- iftrue
, it will be initially hidden.- Returns:
- a new dataset related to chart type.
-
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
-
-