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 BarDatadata()Static factory, constructs anHomogeneousDataimplementation appropriate for aBarChart.getType()booleanOptional check to determine whether the current state of thisChartimplementation instance will generate a drawable JSON string.static BarOptionsoptions()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 anHomogeneousDataimplementation appropriate for aBarChart.- Returns:
- a new
BarDatainstance
-
options
- Returns:
- a new
BarOptionsinstance
-
getType
- Returns:
- type of this
Chartimplementation for proper drawing in JavaScript.
-
isDrawable
public boolean isDrawable()Optional check to determine whether the current state of this
Chartimplementation 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
BarChartis 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
BarChartis drawable in its current state
-