Package overit.geocall.basic.ui.control
Class ChartSerieConfigurationBuilder
java.lang.Object
overit.geocall.basic.ui.control.ChartSerieConfigurationBuilder
@Component
@Scope(value="prototype",
proxyMode=NO)
public class ChartSerieConfigurationBuilder
extends Object
This class is used to build the configuration of the serie chart.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static final record -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance of ChartSerieConfigurationBuilder. -
Method Summary
Modifier and TypeMethodDescriptionaddSerie(overit.geocall.charts.Serie serie, ChartSerieType type, String dataLabelFormat, Color color, boolean stroke, String shape) Adds a serie to the chart.Builds the JSON configuration for the chart.protected JackMapperprotected booleansetDomainFont(overit.geocall.charts.ChartFont domainFont) Sets the font for the values on the domain axis.setDomainLabels(List<String> domainLabels) Sets the domain labels.setDomainRotation(int domainRotation) Sets the rotation for the values on the domain axis.setDomainTitle(String domainTitle) Sets the title for the domain axis.setDomainTitleFont(overit.geocall.charts.ChartFont domainTitleFont) Sets the font for the title of the domain axis.setFixedSize(boolean fixedSize) Sets the fixed size flag.setHorizontal(boolean horizontal) Sets whether the chart should be horizontal.setItemLabelFont(overit.geocall.charts.ChartFont itemLabelFont) Sets the font for the labels of the elements of each serie.setLegendBox(overit.geocall.charts.ChartLegendBox legendBox) Sets the legend box, it supports only the positioningsetLegendFont(overit.geocall.charts.ChartFont legendFont) Sets the legend font.setLegendItemSize(double legendItemSize) Sets the size of the legend items.setShowDomainGridLine(boolean showDomainGridLine) Sets whether the domain grid line should be shown.setShowLegend(boolean showLegend) Sets whether the legend should be shown.setShowValuesGridLine(boolean showValuesGridLine) Sets whether the values grid line should be shown.setStacked(boolean stacked) Sets whether the series should be stacked.setValuesFont(overit.geocall.charts.ChartFont valuesFont) Sets the font for the values on the values axis.setValuesMax(Double valueMax) Sets the maximum value for the values axis.setValuesMin(Double valueMin) Sets the minimum value for the values axis.setValuesStep(Double valuesStep) Sets the step between the values for the values axis.setValuesTitle(String valuesTitle) Sets the title for the values axis.setValuesTitleFont(overit.geocall.charts.ChartFont valuesTitleFont) Sets the font for the title of the values axis.setZoomable(boolean zoomable) Sets whether the chart should be zoomable.
-
Constructor Details
-
ChartSerieConfigurationBuilder
Creates a new instance of ChartSerieConfigurationBuilder.- Parameters:
mapper- The mapper used to serialize the configuration.
-
-
Method Details
-
setFixedSize
Sets the fixed size flag.- Parameters:
fixedSize- The fixed size flag.- Returns:
- This object.
-
addSerie
public ChartSerieConfigurationBuilder addSerie(overit.geocall.charts.Serie serie, ChartSerieType type, String dataLabelFormat, Color color, boolean stroke, String shape) Adds a serie to the chart.- Parameters:
serie- The serie to add.type- The type of the serie.dataLabelFormat- The format for the data labels.color- The color of the serie.stroke- Whether the serie has a stroke, relevant only for line seriesshape- The shape of the serie, relevant only for line series- Returns:
- This object.
-
setDomainLabels
Sets the domain labels.- Parameters:
domainLabels- The domain labels.- Returns:
- This object.
-
setValuesMin
Sets the minimum value for the values axis.- Parameters:
valueMin- The minimum value.- Returns:
- This object.
-
setValuesMax
Sets the maximum value for the values axis.- Parameters:
valueMax- The maximum value.- Returns:
- This object.
-
setLegendFont
Sets the legend font.- Parameters:
legendFont- The legend font.- Returns:
- This object.
-
setLegendBox
Sets the legend box, it supports only the positioning- Parameters:
legendBox- The legend box.- Returns:
- This object.
-
setShowDomainGridLine
Sets whether the domain grid line should be shown.- Parameters:
showDomainGridLine- Whether the domain grid line should be shown.- Returns:
- This object.
-
setShowValuesGridLine
Sets whether the values grid line should be shown.- Parameters:
showValuesGridLine- Whether the values grid line should be shown.- Returns:
- This object.
-
setValuesStep
Sets the step between the values for the values axis.- Parameters:
valuesStep- The step between the values.- Returns:
- This object.
-
setValuesTitle
Sets the title for the values axis.- Parameters:
valuesTitle- The title for the values axis.- Returns:
- This object.
-
setValuesTitleFont
public ChartSerieConfigurationBuilder setValuesTitleFont(overit.geocall.charts.ChartFont valuesTitleFont) Sets the font for the title of the values axis.- Parameters:
valuesTitleFont- The font for the title of the values axis.- Returns:
- This object.
-
setValuesFont
Sets the font for the values on the values axis.- Parameters:
valuesFont- The font for the values on the values axis.- Returns:
- This object.
-
setDomainTitle
Sets the title for the domain axis.- Parameters:
domainTitle- The title for the domain axis.- Returns:
- This object.
-
setDomainTitleFont
public ChartSerieConfigurationBuilder setDomainTitleFont(overit.geocall.charts.ChartFont domainTitleFont) Sets the font for the title of the domain axis.- Parameters:
domainTitleFont- The font for the title of the domain axis.- Returns:
- This object.
-
setDomainFont
Sets the font for the values on the domain axis.- Parameters:
domainFont- The font for the values on the domain axis.- Returns:
- This object.
-
setDomainRotation
Sets the rotation for the values on the domain axis.- Parameters:
domainRotation- The rotation for the values on the domain axis.- Returns:
- This object.
-
setStacked
Sets whether the series should be stacked.- Parameters:
stacked- Whether the series should be stacked.- Returns:
- This object.
-
setLegendItemSize
Sets the size of the legend items.- Parameters:
legendItemSize- The size of the legend items.- Returns:
- This object.
-
setHorizontal
Sets whether the chart should be horizontal.- Parameters:
horizontal- Whether the chart should be horizontal.- Returns:
- This object.
-
setShowLegend
Sets whether the legend should be shown.- Parameters:
showLegend- Whether the legend should be shown.- Returns:
- This object.
-
setZoomable
Sets whether the chart should be zoomable.- Parameters:
zoomable- Whether the chart should be zoomable.- Returns:
- This object.
-
setItemLabelFont
public ChartSerieConfigurationBuilder setItemLabelFont(overit.geocall.charts.ChartFont itemLabelFont) Sets the font for the labels of the elements of each serie.- Parameters:
itemLabelFont- The font for the labels of the elements of each serie.- Returns:
- This object.
-
hasItemLabels
protected boolean hasItemLabels() -
getMapper
-
buildJsonConfiguration
Builds the JSON configuration for the chart.- Returns:
- The JSON configuration for the chart.
-