Package org.pepstock.charba.client.items
Class AxisItem
-
- All Implemented Interfaces:
IsArea
public final class AxisItem extends ScaleItem
There are a number of configuration callbacks that can be used to change parameters in the scale at different points in the update process.
This is a wrapper of the CHART.JS item with all needed info about an axis.
Implements allset
methods to change java script object properties.- Author:
- Andrea "Stock" Stocchero
-
-
Constructor Summary
Constructors Constructor Description AxisItem(ConfigurationEnvelop<NativeObject> envelop)
Creates the item using an envelop of native java script object which contains all properties.
-
Method Summary
All Methods Instance Methods Concrete Methods Default Methods Modifier and Type Method Description default boolean
isInside(NativeBaseEvent event)
Returnstrue
if the chart event is inside of a chart element, otherwisefalse
.default boolean
isInside(HasNativeEvent container)
Returnstrue
if the chart event is inside of this box, otherwisefalse
.void
setBottom(int bottom)
Sets the bottom location in pixelvoid
setEnd(int end)
Sets the end value of the axisvoid
setFullSize(boolean fullSize)
Setstrue
if marks that this box should take the full width/height of the canvas (moving other boxes).void
setHeight(int height)
Sets the height of axis in pixel.void
setLabelRotation(double labelRotation)
Sets the label rotation valuevoid
setLeft(int left)
Sets the left location in pixelvoid
setMax(double max)
Sets the maximum value of axisvoid
setMax(String max)
Sets the maximum value of axisvoid
setMax(Date max)
Sets the maximum value of axisvoid
setMaxHeight(int maxHeight)
Sets the max height of the axis in pixelvoid
setMaxWidth(int maxWidth)
Sets the max width of axis in pixel.void
setMin(double min)
Sets the minimum value of axisvoid
setMin(String min)
Sets the minimum value of axisvoid
setMin(Date min)
Sets the minimum value of axisvoid
setPaddingBottom(int paddingBottom)
Sets the padding bottom in pixelvoid
setPaddingLeft(int paddingLeft)
Sets the padding left in pixelvoid
setPaddingRight(int paddingRight)
Sets the padding right in pixelvoid
setPaddingTop(int paddingTop)
Sets the padding top in pixelvoid
setPosition(Position position)
Sets the position of axisvoid
setRight(int right)
Sets the right location in pixelvoid
setStart(int start)
Sets the start value of the axisvoid
setTicks(String... ticks)
Sets an array of ticksvoid
setTop(int top)
Sets the top location in pixelvoid
setWeight(int weight)
Sets the weight of axisvoid
setWidth(int width)
Sets the width of axis-
Methods inherited from class org.pepstock.charba.client.items.ScaleItem
format, format, format, format, getAxis, getBasePixel, getBaseValue, getCharbaId, getChart, getDateAdapter, getDecimalForPixel, getDistanceFromCenterForValue, getDrawingArea, getEnd, getId, getLabelForValue, getLabelItems, getLabelRotation, getMax, getMaxAsDate, getMaxAsString, getMin, getMinAsDate, getMinAsString, getPixelForDateValue, getPixelForDateValue, getPixelForDecimal, getPixelForStringValue, getPixelForStringValue, getPixelForTick, getPixelForValue, getPixelForValue, getPointLabels, getStart, getTicks, getType, getValueAtEvent, getValueAtEvent, getValueAtPixel, getValueForDistanceFromCenter, getValueForPixel, getXCenter, getYCenter, isHorizontal
-
Methods inherited from class org.pepstock.charba.client.items.BaseBoxNodeItem
getMaxHeight, getMaxWidth, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getPosition, getWeight, isActive, isFullSize
-
Methods inherited from class org.pepstock.charba.client.items.BaseBoxItem
getBottom, getHeight, getLeft, getRight, getTop, getWidth, isInside
-
Methods inherited from class org.pepstock.charba.client.commons.NativeObjectContainer
checkAndGetColor, 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
-
AxisItem
public AxisItem(ConfigurationEnvelop<NativeObject> envelop)
Creates the item using an envelop of native java script object which contains all properties.- Parameters:
envelop
- envelop of native java script object which contains all properties.
-
-
Method Detail
-
setFullSize
public void setFullSize(boolean fullSize)
Setstrue
if marks that this box should take the full width/height of the canvas (moving other boxes).- Parameters:
fullSize
-true
if marks that this box should take the full width/height of the canvas (moving other boxes)
-
setWeight
public void setWeight(int weight)
Sets the weight of axis- Parameters:
weight
- the weight of axis
-
setMaxWidth
public void setMaxWidth(int maxWidth)
Sets the max width of axis in pixel.- Parameters:
maxWidth
- the max width of axis in pixel.
-
setMaxHeight
public void setMaxHeight(int maxHeight)
Sets the max height of the axis in pixel- Parameters:
maxHeight
- the max height of the axis in pixel
-
setHeight
public void setHeight(int height)
Sets the height of axis in pixel.- Parameters:
height
- the height of axis in pixel.
-
setTop
public void setTop(int top)
Sets the top location in pixel- Parameters:
top
- the top location in pixel
-
setBottom
public void setBottom(int bottom)
Sets the bottom location in pixel- Parameters:
bottom
- the bottom location in pixel
-
setPaddingLeft
public void setPaddingLeft(int paddingLeft)
Sets the padding left in pixel- Parameters:
paddingLeft
- the padding left in pixel
-
setPaddingTop
public void setPaddingTop(int paddingTop)
Sets the padding top in pixel- Parameters:
paddingTop
- the padding top in pixel
-
setPaddingRight
public void setPaddingRight(int paddingRight)
Sets the padding right in pixel- Parameters:
paddingRight
- the padding right in pixel
-
setPaddingBottom
public void setPaddingBottom(int paddingBottom)
Sets the padding bottom in pixel- Parameters:
paddingBottom
- the padding bottom in pixel
-
setMin
public void setMin(String min)
Sets the minimum value of axis- Parameters:
min
- the minimum value of axis
-
setMax
public void setMax(String max)
Sets the maximum value of axis- Parameters:
max
- the maximum value of axis
-
setMin
public void setMin(double min)
Sets the minimum value of axis- Parameters:
min
- the minimum value of axis
-
setMax
public void setMax(double max)
Sets the maximum value of axis- Parameters:
max
- the maximum value of axis
-
setMin
public void setMin(Date min)
Sets the minimum value of axis- Parameters:
min
- the minimum value of axis
-
setMax
public void setMax(Date max)
Sets the maximum value of axis- Parameters:
max
- the maximum value of axis
-
setTicks
public void setTicks(String... ticks)
Sets an array of ticks- Parameters:
ticks
- the array of ticks
-
setStart
public void setStart(int start)
Sets the start value of the axis- Parameters:
start
- the start value of the axis
-
setEnd
public void setEnd(int end)
Sets the end value of the axis- Parameters:
end
- the end value of the axis
-
setLabelRotation
public void setLabelRotation(double labelRotation)
Sets the label rotation value- Parameters:
labelRotation
- the label rotation value
-
setWidth
public void setWidth(int width)
Sets the width of axis- Parameters:
width
- the width of axis
-
setLeft
public void setLeft(int left)
Sets the left location in pixel- Parameters:
left
- the left location in pixel
-
setRight
public void setRight(int right)
Sets the right location in pixel- Parameters:
right
- the right location in pixel
-
setPosition
public void setPosition(Position position)
Sets the position of axis- Parameters:
position
- the position of axis
-
isInside
public default boolean isInside(NativeBaseEvent event)
Returnstrue
if the chart event is inside of a chart element, otherwisefalse
.- Parameters:
event
- event to check if inside of a chart element.- Returns:
true
if the chart event is inside a chart element, otherwisefalse
-
isInside
public default boolean isInside(HasNativeEvent container)
Returnstrue
if the chart event is inside of this box, otherwisefalse
.- Parameters:
container
- event container to check if inside the box- Returns:
true
if the chart event is inside of this box, otherwisefalse
-
-