Class Legend
- java.lang.Object
-
- org.pepstock.charba.client.commons.NativeObjectContainer
-
- org.pepstock.charba.client.commons.AbstractNode
-
- org.pepstock.charba.client.options.AbstractModel<Plugins,T>
-
- org.pepstock.charba.client.options.Legend
-
- All Implemented Interfaces:
IsDefaultEventHandler,IsDefaultLegend,IsDefaultPluginElement,IsDefaultTextDirectionHandler,HasEvents
public final class Legend extends AbstractModel<Plugins,T> implements IsDefaultLegend, HasEvents
The chart legend displays data about the datasets that area appearing on the chart.- Author:
- Andrea "Stock" Stocchero
-
-
Method Summary
All Methods Instance Methods Concrete Methods Default Methods Modifier and Type Method Description ElementAligngetAlign()Returns the alignment of the element.EventsOptionHandlergetEventsOptionHandler()Returns a event handler handler instance to use in the default methods of this interface.LegendLabelsgetLabels()Returns the legend labels element.intgetMaxHeight()Returns the maximum width of the legend, in pixels.intgetMaxWidth()Returns the maximum width of the legend, in pixels.PositiongetPosition()Returns the position of element.default TextDirectiongetTextDirection()Returns the text direction that will force on the canvas for rendering the object, regardless of the CSS specified on the canvas.org.pepstock.charba.client.options.TextDirectionHandlergetTextDirectionHandler()LegendTitlegetTitle()Returns the legend title element.booleanisDisplay()Returnstrueif the element is shown.booleanisFullSize()Returns if that this box should take the full width/height of the canvas (moving other boxes).booleanisReverse()Returns if the legend will show datasets in reverse order.default booleanisRtl()Returnstruefor rendering the object from right to left.voidsetAlign(ElementAlign alignment)Sets the alignment of the element.voidsetDisplay(boolean display)Setstrueif the element is shown.voidsetFullSize(boolean fullSize)Marks that this box should take the full width/height of the canvas (moving other boxes).voidsetMaxHeight(int maxHeight)Sets the maximum height of the legend, in pixels.voidsetMaxWidth(int maxWidth)Sets the maximum width of the legend, in pixels.voidsetPosition(Position position)Sets the position of element.voidsetReverse(boolean reverse)Sets the legend will show datasets in reverse order.default voidsetRtl(boolean rtl)Setstruefor rendering the tooltips from right to left.default voidsetTextDirection(TextDirection textDirection)Sets the text direction of the tooltips that will force the text direction on the canvas for rendering the tooltips, regardless of the CSS specified on the canvas.-
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, 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, 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, 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.options.HasEvents
getEvents, setEvents, setEvents
-
Methods inherited from interface org.pepstock.charba.client.defaults.IsDefaultPluginElement
getAlign, getPosition, isDisplay
-
-
-
-
Method Detail
-
getTextDirectionHandler
public org.pepstock.charba.client.options.TextDirectionHandler getTextDirectionHandler()
-
getEventsOptionHandler
public EventsOptionHandler getEventsOptionHandler()
Description copied from interface:HasEventsReturns a event handler handler instance to use in the default methods of this interface.- Specified by:
getEventsOptionHandlerin interfaceHasEvents- Returns:
- a event handler handler instance
-
getLabels
public LegendLabels getLabels()
Returns the legend labels element.- Specified by:
getLabelsin interfaceIsDefaultLegend- Returns:
- the labels
-
getTitle
public LegendTitle getTitle()
Returns the legend title element.- Specified by:
getTitlein interfaceIsDefaultLegend- Returns:
- the title
-
setMaxWidth
public void setMaxWidth(int maxWidth)
Sets the maximum width of the legend, in pixels.- Parameters:
maxWidth- the maximum width of the legend, in pixels
-
getMaxWidth
public int getMaxWidth()
Returns the maximum width of the legend, in pixels.- Specified by:
getMaxWidthin interfaceIsDefaultLegend- Returns:
- the maximum width of the legend, in pixels
-
setMaxHeight
public void setMaxHeight(int maxHeight)
Sets the maximum height of the legend, in pixels.- Parameters:
maxHeight- the maximum height of the legend, in pixels
-
getMaxHeight
public int getMaxHeight()
Returns the maximum width of the legend, in pixels.- Specified by:
getMaxHeightin interfaceIsDefaultLegend- Returns:
- the maximum width of the legend, in pixels
-
setFullSize
public void setFullSize(boolean fullSize)
Marks that this box should take the full width/height of the canvas (moving other boxes).- Parameters:
fullSize- Marks that this box should take the full width/height of the canvas (moving other boxes)
-
isFullSize
public boolean isFullSize()
Returns if that this box should take the full width/height of the canvas (moving other boxes).- Specified by:
isFullSizein interfaceIsDefaultLegend- Returns:
trueif that this box should take the full width/height of the canvas (moving other boxes).
-
setReverse
public void setReverse(boolean reverse)
Sets the legend will show datasets in reverse order.- Parameters:
reverse- legend will show datasets in reverse order.
-
isReverse
public boolean isReverse()
Returns if the legend will show datasets in reverse order.- Specified by:
isReversein interfaceIsDefaultLegend- Returns:
trueif legend will show datasets in reverse order.
-
setRtl
public default void setRtl(boolean rtl)
Setstruefor rendering the tooltips from right to left.- Parameters:
rtl-truefor rendering the tooltips from right to left
-
isRtl
public default boolean isRtl()
Description copied from interface:IsDefaultTextDirectionHandlerReturnstruefor rendering the object from right to left.- Specified by:
isRtlin interfaceIsDefaultTextDirectionHandler- Returns:
truefor rendering the object from right to left.
-
setTextDirection
public default void setTextDirection(TextDirection textDirection)
Sets the text direction of the tooltips that will force the text direction on the canvas for rendering the tooltips, regardless of the CSS specified on the canvas.- Parameters:
textDirection- the text direction of the tooltips.
-
getTextDirection
public default TextDirection getTextDirection()
Description copied from interface:IsDefaultTextDirectionHandlerReturns the text direction that will force on the canvas for rendering the object, regardless of the CSS specified on the canvas.- Specified by:
getTextDirectionin interfaceIsDefaultTextDirectionHandler- Returns:
- the text direction that will force on the canvas for rendering the object, regardless of the CSS specified on the canvas
-
setDisplay
public void setDisplay(boolean display)
Setstrueif the element is shown.- Parameters:
display- iftruethe element is shown.
-
isDisplay
public boolean isDisplay()
Returnstrueif the element is shown.- Specified by:
isDisplayin interfaceIsDefaultPluginElement- Returns:
- if
truethe element is shown.
-
setPosition
public void setPosition(Position position)
Sets the position of element.- Parameters:
position- the position of element.
-
getPosition
public Position getPosition()
Returns the position of element.- Specified by:
getPositionin interfaceIsDefaultPluginElement- Returns:
- the position of element.
-
setAlign
public void setAlign(ElementAlign alignment)
Sets the alignment of the element.- Parameters:
alignment- alignment of the element.
-
getAlign
public ElementAlign getAlign()
Returns the alignment of the element.- Specified by:
getAlignin interfaceIsDefaultPluginElement- Returns:
- alignment of the element.
-
-