TinyBarChart.stacked constructor
TinyBarChart.stacked({})
Creates a TinyBarChart that represents the bars defined by data
.
The width of each bar represents the percentage of space occupied by the data point value in a data space between zero and the "max" value.
The "max" value is equal to options.max
or, when null, the sum of all
bar values.
options
defaults to kDefaultBarChartOptions
See also:
- TinyBarChart.stackedFromDataVectors To build a stacked bar chart from
raw
Vector2
. - TinyBarChart.single to build a bar chart that represents only one value.
Implementation
factory TinyBarChart.stacked({
Key? key,
required Iterable<double> data,
TinyBarChartOptions? options,
double? width,
double? height,
}) {
return TinyBarChart.stackedFromDataVectors(
key: key,
dataPoints: <Vector2>[
for (var index = 0; index < data.length; index++)
Vector2(index.toDouble(), data.elementAt(index))
],
options: options,
width: width,
height: height,
);
}