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 protectedBarElementOptions(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 BarBorderRadiusgetBarBorderRadius()Returns the border radius of the dataset item in pixels asBarBorderRadius.doublegetBarPercentage()Returns the percent (0-1) of the available width each bar should be within the category width.doublegetBase()Returns the base value for the bar in data units along the value axis.
If not set, defaults to the value axis base value.intgetBorderRadius()Returns the bar border radius (in pixels).BorderSkippedgetBorderSkipped()Returns the edge to skip drawing the border for.intgetBorderWidth()Returns the border width of the dataset item in pixels.BarBorderWidthgetBorderWidthAsObject()Returns the border width of the dataset item in pixels asBarBorderWidth.doublegetCategoryPercentage()Returns the percent (0-1) of the available width each category should be within the sample width.protected intgetDefaultBorderWidth()This method must be overrided by all element where the border width is stored in different object.intgetInflateAmount()Returns the amount of pixels to inflate the bar rectangles, when drawing.booleanisAutoInflateAmount()Returnstrueif the amount of pixels to inflate the bar rectangles, when drawing, is automatically calculated.booleanisBorderRadiusAsObject()Returnstrueif the border width is defined asBarBorderRadius.booleanisBorderWidthAsObject()Returnstrueif the border width is defined asBarBorderWidth.voidsetAutoInflateAmount(boolean autoInflateAmount)Setstrueif the amount of pixels to inflate the bar rectangles, when drawing, is automatically calculated.voidsetBarPercentage(double barPercentage)Sets the percent (0-1) of the available width each bar should be within the category width.voidsetBase(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.voidsetBorderRadius(int borderRadius)Sets the bar border radius (in pixels).voidsetBorderRadius(BarBorderRadius borderRadius)Sets the bar border radius (in pixels).voidsetBorderSkipped(boolean borderskip)Sets the edge to skip drawing the border for.voidsetBorderSkipped(BorderSkipped position)Sets the edge to skip drawing the border for.voidsetBorderWidth(BarBorderWidth borderWidth)Sets the border width.voidsetCategoryPercentage(double categoryPercentage)Sets the percent (0-1) of the available width each category should be within the sample width.voidsetInflateAmount(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, retrieveRoot, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setElementAndAddToParent, setInternalCallbackToModel, setInternalCallbackToModel, 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, 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:CommonElementOptionsThis method must be overrided by all element where the border width is stored in different object.- Overrides:
getDefaultBorderWidthin classCommonElementOptions- Returns:
- an undefined integer
-
isBorderWidthAsObject
public boolean isBorderWidthAsObject()
Returnstrueif the border width is defined asBarBorderWidth.- Returns:
trueif the border width is defined asBarBorderWidth
-
getBorderWidth
public int getBorderWidth()
Returns the border width of the dataset item in pixels.- Overrides:
getBorderWidthin 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 final 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 setfalseas border skipped.
-
isBorderRadiusAsObject
public boolean isBorderRadiusAsObject()
Returnstrueif the border width is defined asBarBorderRadius.- Returns:
trueif 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()
Returnstrueif the amount of pixels to inflate the bar rectangles, when drawing, is automatically calculated.- Returns:
trueif the amount of pixels to inflate the bar rectangles, when drawing, is automatically calculated
-
setAutoInflateAmount
public void setAutoInflateAmount(boolean autoInflateAmount)
Setstrueif the amount of pixels to inflate the bar rectangles, when drawing, is automatically calculated.- Parameters:
autoInflateAmount-trueif 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
-
-