Module nl.crashdata.chartjs.data
Class SimpleChartJsDatasetBuilder<E extends Serializable>
- java.lang.Object
-
- nl.crashdata.chartjs.data.simple.builder.SimpleChartJsDatasetBuilder<E>
-
- All Implemented Interfaces:
SimpleChartJsBuilder<SimpleChartJsDataset<E>>
public class SimpleChartJsDatasetBuilder<E extends Serializable> extends Object implements SimpleChartJsBuilder<SimpleChartJsDataset<E>>
-
-
Constructor Summary
Constructors Constructor Description SimpleChartJsDatasetBuilder()
-
Method Summary
-
-
-
Method Detail
-
withBackgroundColors
public SimpleChartJsDatasetBuilder<E> withBackgroundColors(List<ChartJsRGBAColor> backgroundColors)
-
withBorderColors
public SimpleChartJsDatasetBuilder<E> withBorderColors(List<ChartJsRGBAColor> borderColors)
-
withBorderWidths
public SimpleChartJsDatasetBuilder<E> withBorderWidths(List<Integer> borderWidths)
-
withHoverBackgroundColors
public SimpleChartJsDatasetBuilder<E> withHoverBackgroundColors(List<ChartJsRGBAColor> hoverBackgroundColors)
-
withHoverBorderColors
public SimpleChartJsDatasetBuilder<E> withHoverBorderColors(List<ChartJsRGBAColor> hoverBorderColors)
-
withHoverBorderWidths
public SimpleChartJsDatasetBuilder<E> withHoverBorderWidths(List<Integer> hoverBorderWidths)
-
withBackgroundColor
public SimpleChartJsDatasetBuilder<E> withBackgroundColor(ChartJsRGBAColor backgroundColor)
-
withBorderColor
public SimpleChartJsDatasetBuilder<E> withBorderColor(ChartJsRGBAColor borderColor)
-
withBorderWidth
public SimpleChartJsDatasetBuilder<E> withBorderWidth(Integer borderWidth)
-
withHoverBackgroundColor
public SimpleChartJsDatasetBuilder<E> withHoverBackgroundColor(ChartJsRGBAColor hoverBackgroundColor)
-
withHoverBorderColor
public SimpleChartJsDatasetBuilder<E> withHoverBorderColor(ChartJsRGBAColor hoverBorderColor)
-
withHoverBorderWidth
public SimpleChartJsDatasetBuilder<E> withHoverBorderWidth(Integer hoverBorderWidth)
-
withLabel
public SimpleChartJsDatasetBuilder<E> withLabel(String label)
-
withFill
public SimpleChartJsDatasetBuilder<E> withFill(ChartJsFill fill)
-
withDataPoints
public SimpleChartJsDatasetBuilder<E> withDataPoints(List<E> dataPoints)
-
withDataPoints
public <X> SimpleChartJsDatasetBuilder<E> withDataPoints(Collection<X> dataPoints, Function<X,E> converter)
-
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<E extends Serializable>
-
build
public SimpleChartJsDataset<E> build() throws IllegalStateException
Description copied from interface:SimpleChartJsBuilderBuilds a validCsuch thatbuilder.build() != builder.build().- Specified by:
buildin interfaceSimpleChartJsBuilder<E extends Serializable>- Returns:
- a valid
Cif and only ifSimpleChartJsBuilder.isValid()returns true. - Throws:
IllegalStateException- if called whenSimpleChartJsBuilder.isValid()returns false
-
-