TinyBarChart.stacked constructor

TinyBarChart.stacked({
  1. Key? key,
  2. required Iterable<double> data,
  3. TinyBarChartOptions? options,
  4. double? width,
  5. double? height,
})

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:

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,
  );
}