Class Bar
-
- All Implemented Interfaces:
IsDefaultBar,IsDefaultOptionsElement,IsDefaultPointStyleHandler
- Direct Known Subclasses:
ChoroplethBar
public class Bar extends AbstractElement<IsDefaultBar> implements IsDefaultBar
Bar elements are used to represent the bars in a bar chart.- Author:
- Andrea "Stock" Stocchero
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBar(Elements elements, Key childKey, IsDefaultBar defaultValues, NativeObject nativeObject)Creates the object with the parent, the key of this element, default values and native object to map java script properties.
-
Method Summary
All Methods Instance Methods Concrete Methods Default Methods Modifier and Type Method Description intgetBorderRadius()Returns the bar border radius (in pixels).BorderSkippedgetBorderSkipped()Returns the edge to skip drawing the border for.intgetHoverBorderRadius()Returns the bar border radius (in pixels) when hovered.intgetInflateAmount()Returns the amount of pixels to inflate the bar rectangles, when drawing.default PointStylegetPointStyle()Returns the style of the point.default CanvasgetPointStyleAsCanvas()Returns the style of the point as canvas.
If property is missing or not an canvas, returnsnull.default ImggetPointStyleAsImage()Returns the style of the point as image.
If property is missing or not an image, returnsnull.org.pepstock.charba.client.options.PointStyleHandlergetPointStyleHandler()default PointStyleTypegetPointStyleType()Returns the type of point style.booleanisAutoInflateAmount()Returnstrueif the amount of pixels to inflate the bar rectangles, when drawing, is automatically calculated.booleanisEnableBorderRadius()Iftrue, it only shows the borderRadius of a bar when the bar is at the end of the stack.voidsetAutoInflateAmount(boolean autoInflateAmount)Setstrueif the amount of pixels to inflate the bar rectangles, when drawing, is automatically calculated.voidsetBorderRadius(int 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.voidsetEnableBorderRadius(boolean enableBorderRadius)Iftrue, it only shows the borderRadius of a bar when the bar is at the end of the stack.voidsetHoverBorderRadius(int borderRadius)Sets the bar border radius (in pixels) when hovered.voidsetInflateAmount(int inflateAmount)Sets the amount of pixels to inflate the bar rectangles, when drawing.default voidsetPointStyle(Canvas pointStyle)Sets the style of the point as canvas.default voidsetPointStyle(Img pointStyle)Sets the style of the point as image.default voidsetPointStyle(PointStyle pointStyle)Sets the style of the point.-
Methods inherited from class org.pepstock.charba.client.options.AbstractElement
getBackgroundColor, getBackgroundColorAsString, getBorderColor, getBorderColorAsString, getBorderWidth, getHoverBackgroundColor, getHoverBackgroundColorAsString, getHoverBorderColor, getHoverBorderColorAsString, getHoverBorderWidth, setBackgroundColor, setBackgroundColor, setBorderColor, setBorderColor, setBorderWidth, setHoverBackgroundColor, setHoverBackgroundColor, setHoverBorderColor, setHoverBorderColor, setHoverBorderWidth
-
Methods inherited from class org.pepstock.charba.client.options.AbstractModel
getDefaultValues, getParent, loadPadding, setCallbackToModel, setCallbackToModel, setEventToModel
-
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, 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, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, toJSON, type
-
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.defaults.IsDefaultOptionsElement
getBackgroundColorAsString, getBorderColorAsString, getBorderWidth, getHoverBackgroundColorAsString, getHoverBorderColorAsString, getHoverBorderWidth
-
-
-
-
Constructor Detail
-
Bar
protected Bar(Elements elements, Key childKey, IsDefaultBar defaultValues, NativeObject nativeObject)
Creates the object with the parent, the key of this element, default values and native object to map java script properties.- Parameters:
elements- parent node to use to add this element where changedchildKey- the property name of this element to use to add it to the parent.defaultValues- default providernativeObject- native object to map java script properties
-
-
Method Detail
-
getPointStyleHandler
public org.pepstock.charba.client.options.PointStyleHandler getPointStyleHandler()
-
setEnableBorderRadius
public void setEnableBorderRadius(boolean enableBorderRadius)
Iftrue, it only shows the borderRadius of a bar when the bar is at the end of the stack.- Parameters:
enableBorderRadius- iftrue, it only shows the borderRadius of a bar when the bar is at the end of the stack
-
isEnableBorderRadius
public boolean isEnableBorderRadius()
Iftrue, it only shows the borderRadius of a bar when the bar is at the end of the stack.- Specified by:
isEnableBorderRadiusin interfaceIsDefaultBar- Returns:
- if
true, it only shows the borderRadius of a bar when the bar is at the end of the stack
-
setBorderSkipped
public void setBorderSkipped(boolean borderskip)
Sets the edge to skip drawing the border for.- Parameters:
borderskip- to setfalseas border skipped. If settrue, is ignored
-
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.
-
getBorderSkipped
public BorderSkipped getBorderSkipped()
Returns the edge to skip drawing the border for.- Specified by:
getBorderSkippedin interfaceIsDefaultBar- Returns:
- the edge to skip drawing the border for.
-
setBorderRadius
public void setBorderRadius(int borderRadius)
Sets the bar border radius (in pixels).- Parameters:
borderRadius- the bar border radius (in pixels).
-
getBorderRadius
public int getBorderRadius()
Returns the bar border radius (in pixels).- Specified by:
getBorderRadiusin interfaceIsDefaultBar- Returns:
- the bar border radius (in pixels).
-
setHoverBorderRadius
public void setHoverBorderRadius(int borderRadius)
Sets the bar border radius (in pixels) when hovered.- Parameters:
borderRadius- the bar border radius (in pixels) when hovered.
-
getHoverBorderRadius
public int getHoverBorderRadius()
Returns the bar border radius (in pixels) when hovered.- Specified by:
getHoverBorderRadiusin interfaceIsDefaultBar- Returns:
- the bar border radius (in pixels) when hovered.
-
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
-
isAutoInflateAmount
public boolean isAutoInflateAmount()
Returnstrueif the amount of pixels to inflate the bar rectangles, when drawing, is automatically calculated.- Specified by:
isAutoInflateAmountin interfaceIsDefaultBar- Returns:
trueif the amount of pixels to inflate the bar rectangles, when drawing, is automatically calculated
-
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
-
getInflateAmount
public int getInflateAmount()
Returns the amount of pixels to inflate the bar rectangles, when drawing.- Specified by:
getInflateAmountin interfaceIsDefaultBar- Returns:
- the amount of pixels to inflate the bar rectangles, when drawing
-
setPointStyle
public default void setPointStyle(PointStyle pointStyle)
Sets the style of the point.- Parameters:
pointStyle- array of the style of the point.
-
getPointStyle
public default PointStyle getPointStyle()
Returns the style of the point.- Specified by:
getPointStylein interfaceIsDefaultPointStyleHandler- Returns:
- the style of the point or
nullif point style is set as image
-
setPointStyle
public default void setPointStyle(Img pointStyle)
Sets the style of the point as image.- Parameters:
pointStyle- image element of the style of the point as image.
-
getPointStyleType
public default PointStyleType getPointStyleType()
Returns the type of point style.- Specified by:
getPointStyleTypein interfaceIsDefaultPointStyleHandler- Returns:
- the type of point style
-
getPointStyleAsImage
public default Img getPointStyleAsImage()
Returns the style of the point as image.
If property is missing or not an image, returnsnull.- Specified by:
getPointStyleAsImagein interfaceIsDefaultPointStyleHandler- Returns:
- image of the style of the point as image.
If property is missing or not a image, returnsnull.
-
setPointStyle
public default void setPointStyle(Canvas pointStyle)
Sets the style of the point as canvas.- Parameters:
pointStyle- canvas element of the style of the point as canvas.
-
getPointStyleAsCanvas
public default Canvas getPointStyleAsCanvas()
Returns the style of the point as canvas.
If property is missing or not an canvas, returnsnull.- Specified by:
getPointStyleAsCanvasin interfaceIsDefaultPointStyleHandler- Returns:
- image of the style of the point as canvas.
If property is missing or not a canvas, returnsnull.
-
-