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 ElementAlign
getAlign()
Returns the alignment of the element.EventsOptionHandler
getEventsOptionHandler()
Returns a event handler handler instance to use in the default methods of this interface.LegendLabels
getLabels()
Returns the legend labels element.int
getMaxHeight()
Returns the maximum width of the legend, in pixels.int
getMaxWidth()
Returns the maximum width of the legend, in pixels.Position
getPosition()
Returns the position of element.default TextDirection
getTextDirection()
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.TextDirectionHandler
getTextDirectionHandler()
LegendTitle
getTitle()
Returns the legend title element.boolean
isDisplay()
Returnstrue
if the element is shown.boolean
isFullSize()
Returns if that this box should take the full width/height of the canvas (moving other boxes).boolean
isReverse()
Returns if the legend will show datasets in reverse order.default boolean
isRtl()
Returnstrue
for rendering the object from right to left.void
setAlign(ElementAlign alignment)
Sets the alignment of the element.void
setDisplay(boolean display)
Setstrue
if the element is shown.void
setFullSize(boolean fullSize)
Marks that this box should take the full width/height of the canvas (moving other boxes).void
setMaxHeight(int maxHeight)
Sets the maximum height of the legend, in pixels.void
setMaxWidth(int maxWidth)
Sets the maximum width of the legend, in pixels.void
setPosition(Position position)
Sets the position of element.void
setReverse(boolean reverse)
Sets the legend will show datasets in reverse order.default void
setRtl(boolean rtl)
Setstrue
for rendering the tooltips from right to left.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.-
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, retrieveRoot, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setElementAndAddToParent, setInternalCallbackToModel, setInternalCallbackToModel, 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, 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
-
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:HasEvents
Returns a event handler handler instance to use in the default methods of this interface.- Specified by:
getEventsOptionHandler
in interfaceHasEvents
- Returns:
- a event handler handler instance
-
getLabels
public LegendLabels getLabels()
Returns the legend labels element.- Specified by:
getLabels
in interfaceIsDefaultLegend
- Returns:
- the labels
-
getTitle
public LegendTitle getTitle()
Returns the legend title element.- Specified by:
getTitle
in 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:
getMaxWidth
in 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:
getMaxHeight
in 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:
isFullSize
in interfaceIsDefaultLegend
- Returns:
true
if 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:
isReverse
in interfaceIsDefaultLegend
- Returns:
true
if legend will show datasets in reverse order.
-
setRtl
public default void setRtl(boolean rtl)
Setstrue
for rendering the tooltips from right to left.- Parameters:
rtl
-true
for rendering the tooltips from right to left
-
isRtl
public default boolean isRtl()
Description copied from interface:IsDefaultTextDirectionHandler
Returnstrue
for rendering the object from right to left.- Specified by:
isRtl
in interfaceIsDefaultTextDirectionHandler
- Returns:
true
for 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:IsDefaultTextDirectionHandler
Returns the text direction that will force on the canvas for rendering the object, regardless of the CSS specified on the canvas.- Specified by:
getTextDirection
in 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)
Setstrue
if the element is shown.- Parameters:
display
- iftrue
the element is shown.
-
isDisplay
public boolean isDisplay()
Returnstrue
if the element is shown.- Specified by:
isDisplay
in interfaceIsDefaultPluginElement
- Returns:
- if
true
the 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:
getPosition
in 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:
getAlign
in interfaceIsDefaultPluginElement
- Returns:
- alignment of the element.
-
-