Class LegendTitle
- java.lang.Object
-
- org.pepstock.charba.client.configuration.LegendTitle
-
- All Implemented Interfaces:
HasLegendText
public class LegendTitle extends Object implements HasLegendText
This is the title configuration of the legend.- Author:
- Andrea "Stock" Stocchero
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IsChart
getChart()
Returns the chart instanceIsColor
getColor()
Returns the font color.String
getColorAsString()
Returns the font color as string.protected ExtendedOptions
getConfiguration()
Returns the configuration element.Font
getFont()
Returns the font element.LegendTextHandler
getLegendTextHandler()
Returns a legend text handler instance to use in the default methods of this interface.protected ConfigurationOptions
getOptions()
Returns the configuration options.Padding
getPadding()
Returns the padding element.String
getText()
Returns the title text to display.SafeHtml
getTextAsHtml()
Returns the text that will be displayed, as HTML.
If is not HTML, returnsUndefined.STRING
.boolean
isDisplay()
Returnstrue
if the title is shown.boolean
isHtmlText()
Returnstrue
if the text of legend's title is HTML.
This field is used ONLY byHtmlLegend
plugin and not by CHART.js.void
setColor(String color)
Sets the font color.void
setColor(IsColor color)
Sets the font color.void
setDisplay(boolean display)
Setstrue
if the title is shown.void
setHtmlText(boolean htmlText)
Setstrue
if the text of legend's titleis HTML.
This field is used ONLY byHtmlLegend
plugin and not by CHART.js.void
setText(String text)
Sets the title text to display.void
setText(SafeHtml text)
Sets the text that will be displayed, as HTML.
This field is used ONLY byHtmlLegend
plugin and not by CHART.js.
-
-
-
Method Detail
-
getLegendTextHandler
public LegendTextHandler getLegendTextHandler()
Description copied from interface:HasLegendText
Returns a legend text handler instance to use in the default methods of this interface.- Specified by:
getLegendTextHandler
in interfaceHasLegendText
- Returns:
- a legend text handler instance
-
getPadding
public Padding getPadding()
Returns the padding element.- Returns:
- the padding
-
getFont
public Font getFont()
Returns the font element.- Returns:
- the font
-
setColor
public void setColor(IsColor color)
Sets the font color.- Parameters:
color
- font color.
-
setColor
public void setColor(String color)
Sets the font color.- Parameters:
color
- font color.
-
getColorAsString
public String getColorAsString()
Returns the font color as string.- Returns:
- font color as string
-
getColor
public IsColor getColor()
Returns the font color.- Returns:
- font color
-
setDisplay
public void setDisplay(boolean display)
Setstrue
if the title is shown.- Parameters:
display
- iftrue
the title is shown.
-
isDisplay
public boolean isDisplay()
Returnstrue
if the title is shown.- Returns:
- if
true
the title is shown.
-
setText
public void setText(String text)
Sets the title text to display.- Specified by:
setText
in interfaceHasLegendText
- Parameters:
text
- the title text to display.
-
getText
public String getText()
Returns the title text to display.- Specified by:
getText
in interfaceHasLegendText
- Returns:
- the title text to display
-
setText
public void setText(SafeHtml text)
Sets the text that will be displayed, as HTML.
This field is used ONLY byHtmlLegend
plugin and not by CHART.js.- Specified by:
setText
in interfaceHasLegendText
- Parameters:
text
- the text that will be displayed, as HTML
-
getTextAsHtml
public SafeHtml getTextAsHtml()
Returns the text that will be displayed, as HTML.
If is not HTML, returnsUndefined.STRING
. This field is used ONLY byHtmlLegend
plugin and not by CHART.js.- Specified by:
getTextAsHtml
in interfaceHasLegendText
- Returns:
- the text that will be displayed, as HTML.
-
isHtmlText
public boolean isHtmlText()
Returnstrue
if the text of legend's title is HTML.
This field is used ONLY byHtmlLegend
plugin and not by CHART.js.- Specified by:
isHtmlText
in interfaceHasLegendText
- Returns:
true
if the text of legend's title is HTML
-
setHtmlText
public void setHtmlText(boolean htmlText)
Setstrue
if the text of legend's titleis HTML.
This field is used ONLY byHtmlLegend
plugin and not by CHART.js.- Specified by:
setHtmlText
in interfaceHasLegendText
- Parameters:
htmlText
-true
if the text of legend's title is HTML
-
getOptions
protected final ConfigurationOptions getOptions()
Returns the configuration options.- Returns:
- the configuration options.
-
getConfiguration
protected final ExtendedOptions getConfiguration()
Returns the configuration element.- Returns:
- the configuration element.
-
getChart
public final IsChart getChart()
Returns the chart instance- Returns:
- the chart
-
-