Module nl.crashdata.chartjs.data
Class SimpleChartJsLegendConfigBuilder
- java.lang.Object
-
- nl.crashdata.chartjs.data.simple.builder.SimpleChartJsLegendConfigBuilder
-
- All Implemented Interfaces:
SimpleChartJsBuilder<ChartJsLegendConfig>
public class SimpleChartJsLegendConfigBuilder extends Object implements SimpleChartJsBuilder<ChartJsLegendConfig>
-
-
Constructor Summary
Constructors Constructor Description SimpleChartJsLegendConfigBuilder(Supplier<ChartJsChartType> chartTypeSupplier)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ChartJsLegendConfigbuild()Builds a validCsuch thatbuilder.build() != builder.build().booleanisValid()Returnstrueif the state of this builder, including all its delegate builders, is ready to build.SimpleChartJsEventHandlerBuilderonClick()SimpleChartJsLegendConfigBuilderwithDisplay(boolean display)SimpleChartJsLegendConfigBuilderwithFontSize(boolean reverse)SimpleChartJsLegendConfigBuilderwithFullWidth(boolean fullWidth)SimpleChartJsLegendConfigBuilderwithPosition(ChartJsPosition position)SimpleChartJsLegendConfigBuilderwithText(List<String> labels)
-
-
-
Constructor Detail
-
SimpleChartJsLegendConfigBuilder
public SimpleChartJsLegendConfigBuilder(Supplier<ChartJsChartType> chartTypeSupplier)
-
-
Method Detail
-
withDisplay
public SimpleChartJsLegendConfigBuilder withDisplay(boolean display)
-
withFullWidth
public SimpleChartJsLegendConfigBuilder withFullWidth(boolean fullWidth)
-
withFontSize
public SimpleChartJsLegendConfigBuilder withFontSize(boolean reverse)
-
withText
public SimpleChartJsLegendConfigBuilder withText(List<String> labels)
-
withPosition
public SimpleChartJsLegendConfigBuilder withPosition(ChartJsPosition position)
-
onClick
public SimpleChartJsEventHandlerBuilder onClick()
-
isValid
public boolean isValid()
Description copied from interface:SimpleChartJsBuilderReturnstrueif the state of this builder, including all its delegate builders, is ready to build. "Ready to build" means that this builder, including all its delegate builders, is in such a state thatSimpleChartJsBuilder.build()would return a viable SimpleChartJs configuration object.- Specified by:
isValidin interfaceSimpleChartJsBuilder<ChartJsLegendConfig>
-
build
public ChartJsLegendConfig build() throws IllegalStateException
Description copied from interface:SimpleChartJsBuilderBuilds a validCsuch thatbuilder.build() != builder.build().- Specified by:
buildin interfaceSimpleChartJsBuilder<ChartJsLegendConfig>- Returns:
- a valid
Cif and only ifSimpleChartJsBuilder.isValid()returns true. - Throws:
IllegalStateException- if called whenSimpleChartJsBuilder.isValid()returns false
-
-