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 IsChartgetChart()Returns the chart instanceIsColorgetColor()Returns the font color.StringgetColorAsString()Returns the font color as string.protected ExtendedOptionsgetConfiguration()Returns the configuration element.FontgetFont()Returns the font element.LegendTextHandlergetLegendTextHandler()Returns a legend text handler instance to use in the default methods of this interface.protected ConfigurationOptionsgetOptions()Returns the configuration options.PaddinggetPadding()Returns the padding element.StringgetText()Returns the title text to display.SafeHtmlgetTextAsHtml()Returns the text that will be displayed, as HTML.
If is not HTML, returnsUndefined.STRING.booleanisDisplay()Returnstrueif the title is shown.booleanisHtmlText()Returnstrueif the text of legend's title is HTML.
This field is used ONLY byHtmlLegendplugin and not by CHART.js.voidsetColor(String color)Sets the font color.voidsetColor(IsColor color)Sets the font color.voidsetDisplay(boolean display)Setstrueif the title is shown.voidsetHtmlText(boolean htmlText)Setstrueif the text of legend's titleis HTML.
This field is used ONLY byHtmlLegendplugin and not by CHART.js.voidsetText(String text)Sets the title text to display.voidsetText(SafeHtml text)Sets the text that will be displayed, as HTML.
This field is used ONLY byHtmlLegendplugin and not by CHART.js.
-
-
-
Method Detail
-
getLegendTextHandler
public LegendTextHandler getLegendTextHandler()
Description copied from interface:HasLegendTextReturns a legend text handler instance to use in the default methods of this interface.- Specified by:
getLegendTextHandlerin 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)
Setstrueif the title is shown.- Parameters:
display- iftruethe title is shown.
-
isDisplay
public boolean isDisplay()
Returnstrueif the title is shown.- Returns:
- if
truethe title is shown.
-
setText
public void setText(String text)
Sets the title text to display.- Specified by:
setTextin interfaceHasLegendText- Parameters:
text- the title text to display.
-
getText
public String getText()
Returns the title text to display.- Specified by:
getTextin 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 byHtmlLegendplugin and not by CHART.js.- Specified by:
setTextin 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 byHtmlLegendplugin and not by CHART.js.- Specified by:
getTextAsHtmlin interfaceHasLegendText- Returns:
- the text that will be displayed, as HTML.
-
isHtmlText
public boolean isHtmlText()
Returnstrueif the text of legend's title is HTML.
This field is used ONLY byHtmlLegendplugin and not by CHART.js.- Specified by:
isHtmlTextin interfaceHasLegendText- Returns:
trueif the text of legend's title is HTML
-
setHtmlText
public void setHtmlText(boolean htmlText)
Setstrueif the text of legend's titleis HTML.
This field is used ONLY byHtmlLegendplugin and not by CHART.js.- Specified by:
setHtmlTextin interfaceHasLegendText- Parameters:
htmlText-trueif 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
-
-