TinyBarChart.single constructor
TinyBarChart.single({})
Creates a TinyBarChart that represents the percentage of value
in
relation to max
.
Defines a single element to dataPoints based on value
and creates a
TinyBarChartOptions based on max
and color
.
color
defaults to kDefaultBarChartOptions.colorOdd
See also:
- TinyBarChart.stacked To build a bar chart of stacked bars.
- TinyBarChart.stackedFromDataVectors To build a stacked bar chart from
raw
Vector2
.
Implementation
factory TinyBarChart.single({
Key? key,
required double value,
required double max,
Color? color,
double? width,
double? height,
}) {
return TinyBarChart.stackedFromDataVectors(
key: key,
dataPoints: <Vector2>[
Vector2(0, value),
],
options: TinyBarChartOptions(
max: max,
colors: <Color>[color ?? kDefaultBarChartOptions.colors.first],
),
width: width,
height: height,
);
}