public class Legend extends Object
Modifier and Type | Method and Description |
---|---|
ElementAlign |
getAlign()
Returns the alignment of the legend.
|
IsChart |
getChart()
Returns the chart instance
|
protected ExtendedOptions |
getConfiguration()
Returns the configuration element.
|
Set<Event> |
getEvents()
Returns the browser events that the legend should listen to.
|
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.
|
protected ConfigurationOptions |
getOptions()
Returns the configuration options.
|
Position |
getPosition()
Returns the position of the legend.
|
TextDirection |
getTextDirection()
Returns the text direction of the legend that will force the text direction on the canvas for rendering the legend, regardless of the CSS specified on the canvas.
|
LegendTitle |
getTitle()
Returns the legend title element.
|
boolean |
hasClickHandlers()
Returns
true if there is any legend click handler, otherwise false . |
boolean |
hasHoverHandlers()
Returns
true if there is any legend hover handler, otherwise false . |
boolean |
hasLeaveHandlers()
Returns
true if there is any legend leave handler, otherwise false . |
boolean |
isDisplay()
Returns if the legend is shown.
|
boolean |
isFullSize()
Returns if marks 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.
|
boolean |
isRtl()
Returns
true for rendering the legends from right to left. |
void |
onAdd(AddHandlerEvent event)
Invoked when a new event handler is added.
|
void |
onRemove(RemoveHandlerEvent event)
Invoked when a chart event handler is removed.
|
static void |
register(IsChart chart,
org.pepstock.charba.client.configuration.IsEventProvider provider)
Adds the event provider implementation as handlers of chart.
|
void |
setAlign(ElementAlign alignment)
Sets the alignment of the legend.
|
void |
setDisplay(boolean display)
Sets if the legend is shown.
|
void |
setEvents(Event... events)
Sets the browser events that the legend should listen to.
|
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 the legend.
|
void |
setReverse(boolean reverse)
Sets the legend will show datasets in reverse order.
|
void |
setRtl(boolean rtl)
Sets
true for rendering the legends from right to left. |
void |
setTextDirection(TextDirection textDirection)
Sets the text direction of the legend that will force the text direction on the canvas for rendering the legend, regardless of the CSS specified on the canvas.
|
public LegendLabels getLabels()
public LegendTitle getTitle()
public void setEvents(Event... events)
events
- the browser events that the legend should listen to.public Set<Event> getEvents()
public final void onAdd(AddHandlerEvent event)
AddHandlerEventHandler
event
- event to be consumedpublic final void onRemove(RemoveHandlerEvent event)
RemoveHandlerEventHandler
event
- event to be consumedpublic final boolean hasClickHandlers()
true
if there is any legend click handler, otherwise false
.true
if there is any legend click handler, otherwise false
.public final boolean hasHoverHandlers()
true
if there is any legend hover handler, otherwise false
.true
if there is any legend hover handler, otherwise false
.public final boolean hasLeaveHandlers()
true
if there is any legend leave handler, otherwise false
.true
if there is any legend leave handler, otherwise false
.public void setDisplay(boolean display)
display
- if the legend is shown.public boolean isDisplay()
public void setFullSize(boolean fullSize)
fullSize
- Marks that this box should take the full width/height of the canvas (moving other boxes)public boolean isFullSize()
public void setReverse(boolean reverse)
reverse
- legend will show datasets in reverse order.public boolean isReverse()
public void setPosition(Position position)
position
- Position of the legend.public Position getPosition()
public void setAlign(ElementAlign alignment)
alignment
- alignment of the legend.public ElementAlign getAlign()
public void setRtl(boolean rtl)
true
for rendering the legends from right to left.rtl
- true
for rendering the legends from right to leftpublic boolean isRtl()
true
for rendering the legends from right to left.true
for rendering the legends from right to left.public void setTextDirection(TextDirection textDirection)
textDirection
- the text direction of the legend.public TextDirection getTextDirection()
public void setMaxWidth(int maxWidth)
maxWidth
- the maximum width of the legend, in pixelspublic int getMaxWidth()
public void setMaxHeight(int maxHeight)
maxHeight
- the maximum height of the legend, in pixelspublic int getMaxHeight()
public static void register(IsChart chart, org.pepstock.charba.client.configuration.IsEventProvider provider)
chart
- chart instanceprovider
- event provider implmentationprotected final ConfigurationOptions getOptions()
protected final ExtendedOptions getConfiguration()
public final IsChart getChart()