Interface IOptionBuilder
-
- All Known Implementing Classes:
ClassicOptionBuilder,OptionBuilder
public interface IOptionBuilder- Author:
- Dieter Tremel
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description IOptionBuilderaxis(String name)Add a axis with a title from i18n.IOptionBuilderaxis(String name, String title)Add a axis title direct from String.IOptionBuilderaxis(String name, IModel<String> titleModel)Add a axis, give the model for the title of the axis.ChartOptionsbuild()Return the ChartOptions defined by previous fluent calls.StringgetChartBaseResourceKey()Helper function to build resource base key for a chart and it's id according to a convention.IModel<String>getChartLabelResourceModel(String subKey)Generate a wrapped ResourceModel for theChartcomponent.IOptionBuildermapSeries(String axisName)Map a serie to an axis by the axisname.IOptionBuildermapSeries(String axisName, OptionModifier seriesModifier)Map a serie to an axis by the axisname.IOptionBuildermodifyAxis(String name, OptionModifier axisModifier)Add a modifier to configure options for the axis.IOptionBuildersubTitle()Add a subTitle of the chart from i18n.IOptionBuildersubTitle(String subTitle)Add a subTitle of the chart direct from String.IOptionBuildersubTitle(IModel<String> subTitleModel)Give the model for the subTitle of the chart.IOptionBuildertitle()Add a title of the chart from i18n.IOptionBuildertitle(String title)Add a title of the chart direct from String.IOptionBuildertitle(IModel<String> titleModel)Give the model for the title of the chart.
-
-
-
Method Detail
-
getChartBaseResourceKey
String getChartBaseResourceKey()
Helper function to build resource base key for a chart and it's id according to a convention. This should be used as left part for all keys for i18n of charts. Takes the chart id from the chart field.- Returns:
- Base key with trailing dot, eg.
"Chart.myChart."if param is"myChart".
-
getChartLabelResourceModel
IModel<String> getChartLabelResourceModel(String subKey)
Generate a wrapped ResourceModel for theChartcomponent.- Parameters:
subKey- Subkey as suffix ofgetChartBaseResourceKey().- Returns:
- ResourceModel for the complete key. There is no default defined, so missing properties can be easyly detected.
-
title
IOptionBuilder title()
Add a title of the chart from i18n. The key of the ResourceModel is constructed by convention.- Returns:
- IOptionbuilder for fluent api.
- See Also:
OptionBuilder.getChartBaseResourceKey(java.lang.String),getChartBaseResourceKey()
-
title
IOptionBuilder title(String title)
Add a title of the chart direct from String. Convenient function to wrap String in a model.- Parameters:
title- Text of title.- Returns:
- IOptionbuilder for fluent api.
-
title
IOptionBuilder title(IModel<String> titleModel)
Give the model for the title of the chart.- Parameters:
titleModel- Model for title.- Returns:
- IOptionbuilder for fluent api.
-
subTitle
IOptionBuilder subTitle()
Add a subTitle of the chart from i18n. The key of the ResourceModel is constructed by convention.- Returns:
- IOptionbuilder for fluent api.
- See Also:
OptionBuilder.getChartBaseResourceKey(java.lang.String),getChartBaseResourceKey()
-
subTitle
IOptionBuilder subTitle(String subTitle)
Add a subTitle of the chart direct from String. Convenient function to wrap String in a model.- Parameters:
subTitle- Text of subTitle.- Returns:
- IOptionbuilder for fluent api.
-
subTitle
IOptionBuilder subTitle(IModel<String> subTitleModel)
Give the model for the subTitle of the chart.- Parameters:
subTitleModel- Model for subTitle.- Returns:
- IOptionbuilder for fluent api.
-
axis
IOptionBuilder axis(String name)
Add a axis with a title from i18n. The key of the ResourceModel is constructed by convention bygetChartBaseResourceKey()+"axis.name.title".- Parameters:
name- Uniq name for the axis.- Returns:
- IOptionbuilder for fluent api.
- See Also:
OptionBuilder.getChartBaseResourceKey(java.lang.String),getChartBaseResourceKey()
-
axis
IOptionBuilder axis(String name, String title)
Add a axis title direct from String. Convenient function to wrap String in a model.- Parameters:
name- Uniq name for the axis.title- Text of title.- Returns:
- IOptionbuilder for fluent api.
-
axis
IOptionBuilder axis(String name, IModel<String> titleModel)
Add a axis, give the model for the title of the axis.- Parameters:
name- Uniq name for the axis.titleModel- Model for title.- Returns:
- IOptionbuilder for fluent api.
-
modifyAxis
IOptionBuilder modifyAxis(String name, OptionModifier axisModifier)
Add a modifier to configure options for the axis.- Parameters:
name- Name to refer to an axis.axisModifier- Modifier to handle axis options.- Returns:
- IOptionbuilder for fluent api.
-
mapSeries
IOptionBuilder mapSeries(String axisName)
Map a serie to an axis by the axisname.- Parameters:
axisName- Name of a previous defined axis.- Returns:
- IOptionbuilder for fluent api.
-
mapSeries
IOptionBuilder mapSeries(String axisName, OptionModifier seriesModifier)
Map a serie to an axis by the axisname. Aply a modifier to the options of this series.- Parameters:
axisName- Name of a previous defined axis.seriesModifier- Modifierer for the opts of this series.- Returns:
- IOptionbuilder for fluent api.
-
build
ChartOptions build()
Return the ChartOptions defined by previous fluent calls.- Returns:
- ChartOptions as defined.
-
-