Class HtmlLegendOptionsBuilder
- java.lang.Object
-
- org.pepstock.charba.client.commons.AbstractBaseBuilder
-
- org.pepstock.charba.client.impl.plugins.HtmlLegendOptionsBuilder
-
- All Implemented Interfaces:
IsBuilder
public final class HtmlLegendOptionsBuilder extends AbstractBaseBuilder
Comfortable object to createHtmlLegend.ID
plugin options by a builder.- Author:
- Andrea "Stock" Stocchero
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description HtmlLegendOptions
build()
Returns a configured plugin options.static HtmlLegendOptionsBuilder
create()
Returns new builder instance, using the global options as default.static HtmlLegendOptionsBuilder
create(IsChart chart)
Returns new builder instance using chart global options as default.HtmlLegendOptionsBuilder
setDisplay(boolean display)
Sets if the legend is shown.HtmlLegendOptionsBuilder
setLegendItemCallback(HtmlLegendItemCallback legendTextCallback)
Sets the callback which can be implemented to change the text of legend for a specific item, as HTML.HtmlLegendOptionsBuilder
setLegendTitleCallback(HtmlLegendTitleCallback legendTitleCallback)
Sets the callback which can be implemented to change the text of legend's title, as HTML.HtmlLegendOptionsBuilder
setMaximumLegendColumns(int maxColumns)
Sets the maximum amount of columns of legend.-
Methods inherited from class org.pepstock.charba.client.commons.AbstractBaseBuilder
isBuilt, setBuilt
-
-
-
-
Method Detail
-
create
public static HtmlLegendOptionsBuilder create()
Returns new builder instance, using the global options as default.- Returns:
- new builder instance
-
create
public static HtmlLegendOptionsBuilder create(IsChart chart)
Returns new builder instance using chart global options as default.- Parameters:
chart
- chart instance related to the plugin options- Returns:
- new builder instance
-
build
public HtmlLegendOptions build()
Returns a configured plugin options.- Returns:
- a configured plugin options.
-
setDisplay
public HtmlLegendOptionsBuilder setDisplay(boolean display)
Sets if the legend is shown.- Parameters:
display
- if the legend is shown.- Returns:
- new builder instance
-
setLegendItemCallback
public HtmlLegendOptionsBuilder setLegendItemCallback(HtmlLegendItemCallback legendTextCallback)
Sets the callback which can be implemented to change the text of legend for a specific item, as HTML.- Parameters:
legendTextCallback
- the callback which can be implemented to change the text of legend for a specific item, as HTML- Returns:
- new builder instance
-
setLegendTitleCallback
public HtmlLegendOptionsBuilder setLegendTitleCallback(HtmlLegendTitleCallback legendTitleCallback)
Sets the callback which can be implemented to change the text of legend's title, as HTML.- Parameters:
legendTitleCallback
- the callback which can be implemented to change the text of legend's title, as HTML- Returns:
- new builder instance
-
setMaximumLegendColumns
public HtmlLegendOptionsBuilder setMaximumLegendColumns(int maxColumns)
Sets the maximum amount of columns of legend.- Parameters:
maxColumns
- the maximum amount of columns of legend- Returns:
- new builder instance
-
-