public class Legend extends Object
Modifier and Type | Method and Description |
---|---|
LegendAlign |
getAlign()
Returns the alignment of the legend.
|
IsChart |
getChart()
Returns the chart instance
|
protected T |
getConfiguration()
Returns the configuration element.
|
LegendLabels |
getLabels()
Returns the legend labels element.
|
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.
|
boolean |
isDisplay()
Returns if the legend is shown.
|
boolean |
isFullWidth()
Returns if marks that this box should take the full width of the canvas (pushing down 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 |
merge(NativeObjectContainer source,
String property)
Merge a native object into this one with a specific property name.
This is used by plugins implementation (native java script ones) when they are not using the standard way to add plugin configuration into options of chart. |
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(LegendAlign alignment)
Sets the alignment of the legend.
|
protected void |
setConfiguration(T configuration) |
void |
setDisplay(boolean display)
Sets if the legend is shown.
|
void |
setFullWidth(boolean fullWidth)
Marks that this box should take the full width of the canvas (pushing down other boxes).
|
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.
|
String |
toJSON()
Returns the JSON representation of the object.
|
public LegendLabels getLabels()
public final void onAdd(AddHandlerEvent event)
AddHandlerEventHandler
event
- event to be consumedpublic final void onRemove(RemoveHandlerEvent event)
RemoveHandlerEventHandler
event
- event to be consumedpublic void setDisplay(boolean display)
display
- if the legend is shown.public boolean isDisplay()
public void setFullWidth(boolean fullWidth)
fullWidth
- Marks that this box should take the full width of the canvas (pushing down other boxes)public boolean isFullWidth()
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(LegendAlign alignment)
alignment
- alignment of the legend.public LegendAlign 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 static void register(IsChart chart, org.pepstock.charba.client.configuration.IsEventProvider provider)
chart
- chart instanceprovider
- event provider implmentationprotected final void setConfiguration(T configuration)
configuration
- the configuration to setprotected final T getConfiguration()
public final void merge(NativeObjectContainer source, String property)
source
- native object container to addproperty
- property namepublic final String toJSON()
public final IsChart getChart()