Package org.pepstock.charba.client.items
Class BarElementOptions
- java.lang.Object
-
- org.pepstock.charba.client.commons.NativeObjectContainer
-
- org.pepstock.charba.client.commons.AbstractNode
-
- org.pepstock.charba.client.items.ChartElementOptions
-
- org.pepstock.charba.client.items.CommonElementOptions
-
- org.pepstock.charba.client.items.BarElementOptions
-
- Direct Known Subclasses:
GeoFeatureElementOptions
public class BarElementOptions extends CommonElementOptions
Maps the out-of-the-box CHART.JS element options used to represents bars on the charts.- Author:
- Andrea "Stock" Stocchero
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
BarElementOptions(NativeObject nativeObject)
Creates the item using a native java script object which contains all properties.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BarBorderRadius
getBarBorderRadius()
Returns the border radius of the dataset item in pixels asBarBorderRadius
.double
getBarPercentage()
Returns the percent (0-1) of the available width each bar should be within the category width.double
getBase()
Returns the base value for the bar in data units along the value axis.
If not set, defaults to the value axis base value.int
getBorderRadius()
Returns the bar border radius (in pixels).BorderSkipped
getBorderSkipped()
Returns the edge to skip drawing the border for.int
getBorderWidth()
Returns the border width of the dataset item in pixels.BarBorderWidth
getBorderWidthAsObject()
Returns the border width of the dataset item in pixels asBarBorderWidth
.double
getCategoryPercentage()
Returns the percent (0-1) of the available width each category should be within the sample width.protected int
getDefaultBorderWidth()
This method must be overrided by all element where the border width is stored in different object.int
getInflateAmount()
Returns the amount of pixels to inflate the bar rectangles, when drawing.boolean
isAutoInflateAmount()
Returnstrue
if the amount of pixels to inflate the bar rectangles, when drawing, is automatically calculated.boolean
isBorderRadiusAsObject()
Returnstrue
if the border width is defined asBarBorderRadius
.boolean
isBorderWidthAsObject()
Returnstrue
if the border width is defined asBarBorderWidth
.void
setAutoInflateAmount(boolean autoInflateAmount)
Setstrue
if the amount of pixels to inflate the bar rectangles, when drawing, is automatically calculated.void
setBarPercentage(double barPercentage)
Sets the percent (0-1) of the available width each bar should be within the category width.void
setBase(double base)
Sets the base value for the bar in data units along the value axis.
If not set, defaults to the value axis base value.void
setBorderRadius(int borderRadius)
Sets the bar border radius (in pixels).void
setBorderRadius(BarBorderRadius borderRadius)
Sets the bar border radius (in pixels).void
setBorderSkipped(boolean borderskip)
Sets the edge to skip drawing the border for.void
setBorderSkipped(BorderSkipped position)
Sets the edge to skip drawing the border for.void
setBorderWidth(BarBorderWidth borderWidth)
Sets the border width.void
setCategoryPercentage(double categoryPercentage)
Sets the percent (0-1) of the available width each category should be within the sample width.void
setInflateAmount(int inflateAmount)
Sets the amount of pixels to inflate the bar rectangles, when drawing.-
Methods inherited from class org.pepstock.charba.client.items.CommonElementOptions
createTooltipLabelColor, getBackgroundColor, getBackgroundColorAsCanvasGradient, getBackgroundColorAsCanvasPattern, getBackgroundColorAsGradient, getBackgroundColorAsPattern, getBackgroundColorAsString, getBorderColor, getBorderColorAsCanvasGradient, getBorderColorAsGradient, getBorderColorAsString, inRange, inXRange, inYRange, isBackgroundColorAsColor, isBackgroundColorAsGradient, isBackgroundColorAsPattern, isBorderColorAsColor, isBorderColorAsGradient, setBackgroundColor, setBackgroundColor, setBackgroundColor, setBackgroundColor, setBorderColor, setBorderColor, setBorderColor, setBorderWidth
-
Methods inherited from class org.pepstock.charba.client.commons.AbstractNode
checkAndAddToParent, getChildKey, getParentNode, getRootNode, getUpdateListener, retrieveRoot, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setElementAndAddToParent, setInternalCallbackToModel, setInternalCallbackToModel, setUpdateListener, setValueAndAddToParent, 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, 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, setValue, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, toJSON, type
-
-
-
-
Constructor Detail
-
BarElementOptions
protected BarElementOptions(NativeObject nativeObject)
Creates the item using a native java script object which contains all properties.- Parameters:
nativeObject
- native java script object which contains all properties.
-
-
Method Detail
-
getDefaultBorderWidth
protected int getDefaultBorderWidth()
Description copied from class:CommonElementOptions
This method must be overrided by all element where the border width is stored in different object.- Overrides:
getDefaultBorderWidth
in classCommonElementOptions
- Returns:
- an undefined integer
-
isBorderWidthAsObject
public boolean isBorderWidthAsObject()
Returnstrue
if the border width is defined asBarBorderWidth
.- Returns:
true
if the border width is defined asBarBorderWidth
-
getBorderWidth
public int getBorderWidth()
Returns the border width of the dataset item in pixels.- Overrides:
getBorderWidth
in classCommonElementOptions
- Returns:
- the border width of the dataset item in pixels.
-
getBorderWidthAsObject
public BarBorderWidth getBorderWidthAsObject()
Returns the border width of the dataset item in pixels asBarBorderWidth
.- Returns:
- the border width of the dataset item in pixels as
BarBorderWidth
.
-
setBorderWidth
public void setBorderWidth(BarBorderWidth borderWidth)
Sets the border width.- Parameters:
borderWidth
- the border width.
-
getBarPercentage
public double getBarPercentage()
Returns the percent (0-1) of the available width each bar should be within the category width. 1.0 will take the whole category width and put the bars right next to each other.- Returns:
- percent (0-1) of the available width each bar should be within the category width. 1.0 will take the whole category width and put the bars right next to each other.
-
setBarPercentage
public void setBarPercentage(double barPercentage)
Sets the percent (0-1) of the available width each bar should be within the category width. 1.0 will take the whole category width and put the bars right next to each other.- Parameters:
barPercentage
- percent (0-1) of the available width each bar should be within the category width. 1.0 will take the whole category width and put the bars right next to each other.
-
getCategoryPercentage
public double getCategoryPercentage()
Returns the percent (0-1) of the available width each category should be within the sample width.- Returns:
- the percent (0-1) of the available width each category should be within the sample width.
-
setCategoryPercentage
public void setCategoryPercentage(double categoryPercentage)
Sets the percent (0-1) of the available width each category should be within the sample width.- Parameters:
categoryPercentage
- percent (0-1) of the available width each category should be within the sample width.
-
getBase
public double getBase()
Returns the base value for the bar in data units along the value axis.
If not set, defaults to the value axis base value.- Returns:
- base value for the bar in data units along the value axis.
If not set, defaults to the value axis base value
-
setBase
public void setBase(double base)
Sets the base value for the bar in data units along the value axis.
If not set, defaults to the value axis base value.- Parameters:
base
- base value for the bar in data units along the value axis.
If not set, defaults to the value axis base value
-
getBorderSkipped
public BorderSkipped getBorderSkipped()
Returns the edge to skip drawing the border for.- Returns:
- the edge to skip drawing the border for.
-
setBorderSkipped
public void setBorderSkipped(BorderSkipped position)
Sets the edge to skip drawing the border for.- Parameters:
position
- the edge to skip drawing the border for.
-
setBorderSkipped
public void setBorderSkipped(boolean borderskip)
Sets the edge to skip drawing the border for.- Parameters:
borderskip
- to setfalse
as border skipped.
-
isBorderRadiusAsObject
public boolean isBorderRadiusAsObject()
Returnstrue
if the border width is defined asBarBorderRadius
.- Returns:
true
if the border width is defined asBarBorderRadius
-
getBorderRadius
public int getBorderRadius()
Returns the bar border radius (in pixels).- Returns:
- the bar border radius (in pixels).
-
setBorderRadius
public void setBorderRadius(int borderRadius)
Sets the bar border radius (in pixels).- Parameters:
borderRadius
- the bar border radius (in pixels).
-
getBarBorderRadius
public BarBorderRadius getBarBorderRadius()
Returns the border radius of the dataset item in pixels asBarBorderRadius
.- Returns:
- the border radius of the dataset item in pixels as
BarBorderRadius
.
-
setBorderRadius
public void setBorderRadius(BarBorderRadius borderRadius)
Sets the bar border radius (in pixels).- Parameters:
borderRadius
- the bar border radius (in pixels).
-
isAutoInflateAmount
public boolean isAutoInflateAmount()
Returnstrue
if the amount of pixels to inflate the bar rectangles, when drawing, is automatically calculated.- Returns:
true
if the amount of pixels to inflate the bar rectangles, when drawing, is automatically calculated
-
setAutoInflateAmount
public void setAutoInflateAmount(boolean autoInflateAmount)
Setstrue
if the amount of pixels to inflate the bar rectangles, when drawing, is automatically calculated.- Parameters:
autoInflateAmount
-true
if the amount of pixels to inflate the bar rectangles, when drawing, is automatically calculated
-
getInflateAmount
public int getInflateAmount()
Returns the amount of pixels to inflate the bar rectangles, when drawing.- Returns:
- the amount of pixels to inflate the bar rectangles, when drawing
-
setInflateAmount
public void setInflateAmount(int inflateAmount)
Sets the amount of pixels to inflate the bar rectangles, when drawing.- Parameters:
inflateAmount
- the amount of pixels to inflate the bar rectangles, when drawing
-
-