Class DefaultChartLegend
- java.lang.Object
-
- org.pepstock.charba.client.defaults.chart.DefaultChartLegend
-
- All Implemented Interfaces:
IsDefaultEventHandler
,IsDefaultLegend
,IsDefaultPluginElement
,IsDefaultTextDirectionHandler
public final class DefaultChartLegend extends Object implements IsDefaultLegend
Defaults for legend option element, based on chart type.- Author:
- Andrea "Stock" Stocchero
-
-
Constructor Summary
Constructors Constructor Description DefaultChartLegend(IsDefaultLegend legend)
Creates the object by legend option element instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ElementAlign
getAlign()
Returns the alignment of the element.Set<Event>
getEvents()
Returns the browser events that the chart should listen to.IsDefaultLegendLabels
getLabels()
Returns the labels object defaults.int
getMaxHeight()
Returns the maximum height of the legend, in pixels.int
getMaxWidth()
Returns the maximum width of the legend, in pixels.Position
getPosition()
Returns the position of element.TextDirection
getTextDirection()
Returns the text direction that will force on the canvas for rendering the object, regardless of the CSS specified on the canvas.IsDefaultLegendTitle
getTitle()
Returns the title object defaults.boolean
isDisplay()
Returns if the element is shown.boolean
isFullSize()
Returnstrue
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()
Returnstrue
for rendering the object from right to left.
-
-
-
Constructor Detail
-
DefaultChartLegend
public DefaultChartLegend(IsDefaultLegend legend)
Creates the object by legend option element instance.- Parameters:
legend
- legend option element instance.
-
-
Method Detail
-
getLabels
public IsDefaultLegendLabels getLabels()
Description copied from interface:IsDefaultLegend
Returns the labels object defaults.- Specified by:
getLabels
in interfaceIsDefaultLegend
- Returns:
- the labels object instance
-
getTitle
public IsDefaultLegendTitle getTitle()
Description copied from interface:IsDefaultLegend
Returns the title object defaults.- Specified by:
getTitle
in interfaceIsDefaultLegend
- Returns:
- the title object instance
-
getEvents
public Set<Event> getEvents()
Description copied from interface:IsDefaultEventHandler
Returns the browser events that the chart should listen to.- Specified by:
getEvents
in interfaceIsDefaultEventHandler
- Returns:
- the browser events that the chart should listen to.
-
isDisplay
public boolean isDisplay()
Description copied from interface:IsDefaultPluginElement
Returns if the element is shown.- Specified by:
isDisplay
in interfaceIsDefaultPluginElement
- Returns:
- if the element is shown.
-
isFullSize
public boolean isFullSize()
Description copied from interface:IsDefaultLegend
Returnstrue
if marks that this box should take the full width/height of the canvas (moving other boxes).- Specified by:
isFullSize
in interfaceIsDefaultLegend
- Returns:
true
if marks that this box should take the full width/height of the canvas (moving other boxes)
-
isReverse
public boolean isReverse()
Description copied from interface:IsDefaultLegend
Returns if the legend will show datasets in reverse order.- Specified by:
isReverse
in interfaceIsDefaultLegend
- Returns:
- legend will show datasets in reverse order.
-
getPosition
public Position getPosition()
Description copied from interface:IsDefaultPluginElement
Returns the position of element.- Specified by:
getPosition
in interfaceIsDefaultPluginElement
- Returns:
- the position of element.
-
getAlign
public ElementAlign getAlign()
Description copied from interface:IsDefaultPluginElement
Returns the alignment of the element.- Specified by:
getAlign
in interfaceIsDefaultPluginElement
- Returns:
- alignment of the element.
-
isRtl
public 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.
-
getTextDirection
public 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
-
getMaxWidth
public int getMaxWidth()
Description copied from interface:IsDefaultLegend
Returns the maximum width of the legend, in pixels.- Specified by:
getMaxWidth
in interfaceIsDefaultLegend
- Returns:
- the maximum width of the legend, in pixels
-
getMaxHeight
public int getMaxHeight()
Description copied from interface:IsDefaultLegend
Returns the maximum height of the legend, in pixels.- Specified by:
getMaxHeight
in interfaceIsDefaultLegend
- Returns:
- the maximum height of the legend, in pixels
-
-