Class BarChart
java.lang.Object
software.xdev.chartjs.model.charts.AbstractChart<T,O,D>
software.xdev.chartjs.model.charts.HomogeneousChart<BarChart,BarOptions,BarData>
software.xdev.chartjs.model.charts.BarChart
- All Implemented Interfaces:
Chart<BarChart,
BarOptions, BarData>
-
Field Summary
Fields inherited from class software.xdev.chartjs.model.charts.AbstractChart
data, defaultObjectWriter, options
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BarData
data()
Static factory, constructs anHomogeneousData
implementation appropriate for aBarChart
.getType()
boolean
Optional check to determine whether the current state of thisChart
implementation instance will generate a drawable JSON string.static BarOptions
options()
Methods inherited from class software.xdev.chartjs.model.charts.AbstractChart
getData, getDefaultObjectWriter, getOptions, self, setData, setDefaultObjectWriter, setOptions, toJsonNative
-
Constructor Details
-
BarChart
public BarChart() -
BarChart
-
BarChart
-
-
Method Details
-
data
Static factory, constructs anHomogeneousData
implementation appropriate for aBarChart
.- Returns:
- a new
BarData
instance
-
options
- Returns:
- a new
BarOptions
instance
-
getType
- Returns:
- type of this
Chart
implementation for proper drawing in JavaScript.
-
isDrawable
public boolean isDrawable()Optional check to determine whether the current state of this
Chart
implementation instance will generate a drawable JSON string.Implementations provide a best-effort evaluation, and can not guarantee that the serialized chart will be rendered correctly.
A
BarChart
is drawable if:- at least one dataset has at least one data point
- an xAxis scale exists with the id of the xAxisID set on a dataset, if such an id set
- a yAxis scale exists with the id of the yAxisID set on a dataset, if such an id is set
- there is at least one label in the
BarData
- Returns:
- true if this
BarChart
is drawable in its current state
-