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 intDEFAULT_INDICATOR_WIDTHDefault indicator width options, 10.static intDEFAULT_LENGTHDefault length options, 100.static intDEFAULT_MARGINDefault margin options, 8.static intDEFAULT_WIDTHDefault width options, 50.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AligngetAlign()Returns the alignment of the legend on the chart area.AlignCallbackgetAlignCallback()Returns the callback to set the alignment of the legend on the chart area.intgetIndicatorWidth()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.intgetLength()Returns the length of the legend.LengthCallbackgetLengthCallback()Returns the callback to set length of the legend.intgetMargin()Returns the margin pixels such that it doesn't stick to the edge of the chart.MargingetMarginAsObject()Returns the margin pixels such that it doesn't stick to the edge of the chart.MarginCallbackgetMarginCallback()Returns the callback to set the margin pixels such that it doesn't stick to the edge of the chart.PositiongetPosition()Returns the location of the legend on the chart area.PositionPointgetPositionAsPoint()Returns the location of the legend on the chart area.PositionCallbackgetPositionCallback()Returns the callback to set the location of the legend on the chart area.intgetWidth()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.voidsetAlign(AlignCallback alignCallback)Sets the alignment of the legend on the chart area.voidsetAlign(Align align)Sets the alignment of the legend on the chart area.voidsetIndicatorWidth(int width)Sets how many pixels should be used for the color bar.voidsetIndicatorWidth(WidthCallback<ScaleContext> indicatorWidthCallback)Sets how many pixels should be used for the color bar.voidsetLength(int length)Sets the length of the legend.voidsetLength(LengthCallback lengthCallback)Sets the length of the legend.voidsetMargin(int margin)Sets the margin pixels such that it doesn't stick to the edge of the chart.voidsetMargin(MarginCallback marginCallback)Sets the margin pixels such that it doesn't stick to the edge of the chart.voidsetMargin(Margin margin)Sets the margin pixels such that it doesn't stick to the edge of the chart.voidsetPosition(PositionCallback positionCallback)Sets the location of the legend on the chart area.voidsetPosition(Position position)Sets the location of the legend on the chart area.voidsetPosition(PositionPoint position)Sets the location of the legend on the chart area.voidsetWidth(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.voidsetWidth(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
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
-
-
-
-
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
-
-