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:
- IsDefaultLegend,- IsDefaultPluginElement,- IsDefaultTextDirectionHandler
 
 public final class Legend extends AbstractModel<Plugins,T> implements IsDefaultLegend The chart legend displays data about the datasets that area appearing on the chart.- Author:
- Andrea "Stock" Stocchero
 
- 
- 
Method SummaryAll Methods Instance Methods Concrete Methods Default Methods Modifier and Type Method Description ElementAligngetAlign()Returns the alignment of the element.Set<Event>getEvents()Returns the browser events that the legend should listen to.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.voidsetEvents(Set<Event> events)Sets the browser events that the legend should listen to.voidsetEvents(Event... events)Sets the browser events that the legend should listen to.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.AbstractModelgetDefaultValues, getParent, loadPadding, setCallbackToModel, setCallbackToModel, setEventToModel
 - 
Methods inherited from class org.pepstock.charba.client.commons.AbstractNodecheckAndAddToParent, 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.NativeObjectContainercheckDefaultValuesArgument, 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.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.pepstock.charba.client.defaults.IsDefaultPluginElementgetAlign, getPosition, isDisplay
 
- 
 
- 
- 
- 
Method Detail- 
getTextDirectionHandlerpublic org.pepstock.charba.client.options.TextDirectionHandler getTextDirectionHandler() 
 - 
getLabelspublic LegendLabels getLabels() Returns the legend labels element.- Specified by:
- getLabelsin interface- IsDefaultLegend
- Returns:
- the labels
 
 - 
getTitlepublic LegendTitle getTitle() Returns the legend title element.- Specified by:
- getTitlein interface- IsDefaultLegend
- Returns:
- the title
 
 - 
setEventspublic void setEvents(Event... events) Sets the browser events that the legend should listen to.- Parameters:
- events- the browser events that the legend should listen to.
 
 - 
setEventspublic void setEvents(Set<Event> events) Sets the browser events that the legend should listen to.- Parameters:
- events- the browser events that the legend should listen to.
 
 - 
getEventspublic Set<Event> getEvents() Returns the browser events that the legend should listen to.- Specified by:
- getEventsin interface- IsDefaultLegend
- Returns:
- the browser events that the legend should listen to.
 
 - 
setMaxWidthpublic void setMaxWidth(int maxWidth) Sets the maximum width of the legend, in pixels.- Parameters:
- maxWidth- the maximum width of the legend, in pixels
 
 - 
getMaxWidthpublic int getMaxWidth() Returns the maximum width of the legend, in pixels.- Specified by:
- getMaxWidthin interface- IsDefaultLegend
- Returns:
- the maximum width of the legend, in pixels
 
 - 
setMaxHeightpublic void setMaxHeight(int maxHeight) Sets the maximum height of the legend, in pixels.- Parameters:
- maxHeight- the maximum height of the legend, in pixels
 
 - 
getMaxHeightpublic int getMaxHeight() Returns the maximum width of the legend, in pixels.- Specified by:
- getMaxHeightin interface- IsDefaultLegend
- Returns:
- the maximum width of the legend, in pixels
 
 - 
setFullSizepublic 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)
 
 - 
isFullSizepublic boolean isFullSize() Returns if that this box should take the full width/height of the canvas (moving other boxes).- Specified by:
- isFullSizein interface- IsDefaultLegend
- Returns:
- trueif that this box should take the full width/height of the canvas (moving other boxes).
 
 - 
setReversepublic void setReverse(boolean reverse) Sets the legend will show datasets in reverse order.- Parameters:
- reverse- legend will show datasets in reverse order.
 
 - 
isReversepublic boolean isReverse() Returns if the legend will show datasets in reverse order.- Specified by:
- isReversein interface- IsDefaultLegend
- Returns:
- trueif legend will show datasets in reverse order.
 
 - 
setRtlpublic default void setRtl(boolean rtl) Setstruefor rendering the tooltips from right to left.- Parameters:
- rtl-- truefor rendering the tooltips from right to left
 
 - 
isRtlpublic default boolean isRtl() Description copied from interface:IsDefaultTextDirectionHandlerReturnstruefor rendering the object from right to left.- Specified by:
- isRtlin interface- IsDefaultTextDirectionHandler
- Returns:
- truefor rendering the object from right to left.
 
 - 
setTextDirectionpublic 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.
 
 - 
getTextDirectionpublic 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 interface- IsDefaultTextDirectionHandler
- Returns:
- the text direction that will force on the canvas for rendering the object, regardless of the CSS specified on the canvas
 
 - 
setDisplaypublic void setDisplay(boolean display) Setstrueif the element is shown.- Parameters:
- display- if- truethe element is shown.
 
 - 
isDisplaypublic boolean isDisplay() Returnstrueif the element is shown.- Specified by:
- isDisplayin interface- IsDefaultPluginElement
- Returns:
- if truethe element is shown.
 
 - 
setPositionpublic void setPosition(Position position) Sets the position of element.- Parameters:
- position- the position of element.
 
 - 
getPositionpublic Position getPosition() Returns the position of element.- Specified by:
- getPositionin interface- IsDefaultPluginElement
- Returns:
- the position of element.
 
 - 
setAlignpublic void setAlign(ElementAlign alignment) Sets the alignment of the element.- Parameters:
- alignment- alignment of the element.
 
 - 
getAlignpublic ElementAlign getAlign() Returns the alignment of the element.- Specified by:
- getAlignin interface- IsDefaultPluginElement
- Returns:
- alignment of the element.
 
 
- 
 
-