Package org.pepstock.charba.client.geo
Class Legend
- java.lang.Object
-
- org.pepstock.charba.client.commons.NativeObjectContainer
-
- org.pepstock.charba.client.commons.AbstractNode
-
- org.pepstock.charba.client.geo.Legend
-
public final class Legend extends AbstractNode
Legend configuration for GEO chart scale.- Author:
- Andrea "Stock" Stocchero
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_INDICATOR_WIDTH
Default indicator width options, 10.static int
DEFAULT_LENGTH
Default length options, 100.static int
DEFAULT_MARGIN
Default margin options, 8.static int
DEFAULT_WIDTH
Default width options, 50.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Align
getAlign()
Returns the alignment of the legend on the chart area.AlignCallback
getAlignCallback()
Returns the callback to set the alignment of the legend on the chart area.int
getIndicatorWidth()
Returns how many pixels should be used for the color bar.WidthCallback<ScaleContext>
getIndicatorWidthCallback()
Returns the callback to set how many pixels should be used for the color bar.int
getLength()
Returns the length of the legend.LengthCallback
getLengthCallback()
Returns the callback to set length of the legend.int
getMargin()
Returns the margin pixels such that it doesn't stick to the edge of the chart.Margin
getMarginAsObject()
Returns the margin pixels such that it doesn't stick to the edge of the chart.MarginCallback
getMarginCallback()
Returns the callback to set the margin pixels such that it doesn't stick to the edge of the chart.Position
getPosition()
Returns the location of the legend on the chart area.PositionPoint
getPositionAsPoint()
Returns the location of the legend on the chart area.PositionCallback
getPositionCallback()
Returns the callback to set the location of the legend on the chart area.int
getWidth()
Returns how wide the scale is.
For a horizontal scale the height if a value less than 1 is given, is it assume to be a ratio of the corresponding chart area.WidthCallback<ScaleContext>
getWidthCallback()
Returns the callback to set how wide the scale is.void
setAlign(AlignCallback alignCallback)
Sets the alignment of the legend on the chart area.void
setAlign(Align align)
Sets the alignment of the legend on the chart area.void
setIndicatorWidth(int width)
Sets how many pixels should be used for the color bar.void
setIndicatorWidth(WidthCallback<ScaleContext> indicatorWidthCallback)
Sets how many pixels should be used for the color bar.void
setLength(int length)
Sets the length of the legend.void
setLength(LengthCallback lengthCallback)
Sets the length of the legend.void
setMargin(int margin)
Sets the margin pixels such that it doesn't stick to the edge of the chart.void
setMargin(MarginCallback marginCallback)
Sets the margin pixels such that it doesn't stick to the edge of the chart.void
setMargin(Margin margin)
Sets the margin pixels such that it doesn't stick to the edge of the chart.void
setPosition(PositionCallback positionCallback)
Sets the location of the legend on the chart area.void
setPosition(Position position)
Sets the location of the legend on the chart area.void
setPosition(PositionPoint position)
Sets the location of the legend on the chart area.void
setWidth(int width)
Sets how wide the scale is.
For a horizontal scale the height if a value less than 1 is given, is it assume to be a ratio of the corresponding chart area.void
setWidth(WidthCallback<ScaleContext> widthCallback)
Sets how wide the scale is.-
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
-
-
-
-
Field Detail
-
DEFAULT_LENGTH
public static final int DEFAULT_LENGTH
Default length options, 100.- See Also:
- Constant Field Values
-
DEFAULT_WIDTH
public static final int DEFAULT_WIDTH
Default width options, 50.- See Also:
- Constant Field Values
-
DEFAULT_INDICATOR_WIDTH
public static final int DEFAULT_INDICATOR_WIDTH
Default indicator width options, 10.- See Also:
- Constant Field Values
-
DEFAULT_MARGIN
public static final int DEFAULT_MARGIN
Default margin options, 8.- See Also:
- Constant Field Values
-
-
Method Detail
-
setPosition
public void setPosition(Position position)
Sets the location of the legend on the chart area.- Parameters:
position
- the location of the legend on the chart area
-
setPosition
public void setPosition(PositionPoint position)
Sets the location of the legend on the chart area.- Parameters:
position
- the location of the legend on the chart area
-
getPosition
public Position getPosition()
Returns the location of the legend on the chart area.- Returns:
- the location of the legend on the chart area
-
getPositionAsPoint
public PositionPoint getPositionAsPoint()
Returns the location of the legend on the chart area.- Returns:
- the location of the legend on the chart area
-
setAlign
public void setAlign(Align align)
Sets the alignment of the legend on the chart area.- Parameters:
align
- the alignment of the legend on the chart area
-
getAlign
public Align getAlign()
Returns the alignment of the legend on the chart area.- Returns:
- the alignment of the legend on the chart area
-
setLength
public void setLength(int length)
Sets the length of the legend.- Parameters:
length
- the length of the legend
-
getLength
public int getLength()
Returns the length of the legend.- Returns:
- the length of the legend
-
setWidth
public void setWidth(int width)
Sets how wide the scale is.
For a horizontal scale the height if a value less than 1 is given, is it assume to be a ratio of the corresponding chart area.- Parameters:
width
- how wide the scale is
-
getWidth
public int getWidth()
Returns how wide the scale is.
For a horizontal scale the height if a value less than 1 is given, is it assume to be a ratio of the corresponding chart area.- Returns:
- how wide the scale is
-
setIndicatorWidth
public void setIndicatorWidth(int width)
Sets how many pixels should be used for the color bar.- Parameters:
width
- how many pixels should be used for the color bar
-
getIndicatorWidth
public int getIndicatorWidth()
Returns how many pixels should be used for the color bar.- Returns:
- how many pixels should be used for the color bar
-
setMargin
public void setMargin(int margin)
Sets the margin pixels such that it doesn't stick to the edge of the chart.- Parameters:
margin
- the margin pixels such that it doesn't stick to the edge of the chart
-
setMargin
public void setMargin(Margin margin)
Sets the margin pixels such that it doesn't stick to the edge of the chart.- Parameters:
margin
- the margin pixels such that it doesn't stick to the edge of the chart
-
getMargin
public int getMargin()
Returns the margin pixels such that it doesn't stick to the edge of the chart.- Returns:
- the margin pixels such that it doesn't stick to the edge of the chart
-
getMarginAsObject
public Margin getMarginAsObject()
Returns the margin pixels such that it doesn't stick to the edge of the chart.- Returns:
- the margin pixels such that it doesn't stick to the edge of the chart
-
setPosition
public void setPosition(PositionCallback positionCallback)
Sets the location of the legend on the chart area.- Parameters:
positionCallback
- the callback to set the location of the legend on the chart area
-
getPositionCallback
public PositionCallback getPositionCallback()
Returns the callback to set the location of the legend on the chart area.- Returns:
- the callback to set the location of the legend on the chart area
-
setAlign
public void setAlign(AlignCallback alignCallback)
Sets the alignment of the legend on the chart area.- Parameters:
alignCallback
- the alignment of the legend on the chart area.
-
getAlignCallback
public AlignCallback getAlignCallback()
Returns the callback to set the alignment of the legend on the chart area.- Returns:
- the callback to set the alignment of the legend on the chart area
-
setLength
public void setLength(LengthCallback lengthCallback)
Sets the length of the legend.- Parameters:
lengthCallback
- the callback to set length of the legend.
-
getLengthCallback
public LengthCallback getLengthCallback()
Returns the callback to set length of the legend.- Returns:
- the callback to set length of the legend
-
setWidth
public void setWidth(WidthCallback<ScaleContext> widthCallback)
Sets how wide the scale is.- Parameters:
widthCallback
- the callback to set how wide the scale is
-
getWidthCallback
public WidthCallback<ScaleContext> getWidthCallback()
Returns the callback to set how wide the scale is.- Returns:
- the callback to set how wide the scale is
-
setIndicatorWidth
public void setIndicatorWidth(WidthCallback<ScaleContext> indicatorWidthCallback)
Sets how many pixels should be used for the color bar.- Parameters:
indicatorWidthCallback
- the callback to set how many pixels should be used for the color bar
-
getIndicatorWidthCallback
public WidthCallback<ScaleContext> getIndicatorWidthCallback()
Returns the callback to set how many pixels should be used for the color bar.- Returns:
- the callback to set how many pixels should be used for the color bar
-
setMargin
public void setMargin(MarginCallback marginCallback)
Sets the margin pixels such that it doesn't stick to the edge of the chart.- Parameters:
marginCallback
- the callback to set the margin pixels such that it doesn't stick to the edge of the chart
-
getMarginCallback
public MarginCallback getMarginCallback()
Returns the callback to set the margin pixels such that it doesn't stick to the edge of the chart.- Returns:
- the callback to set the margin pixels such that it doesn't stick to the edge of the chart
-
-