stackedData method
Generates stacked data.
Implementation
List<Map<String, dynamic>> stackedData({
int categories = 10,
List<String>? categoryNames,
List<String>? seriesNames,
int seriesCount = 4,
double minValue = 10,
double maxValue = 50,
}) {
final series =
seriesNames ?? List.generate(seriesCount, (i) => 'Series ${i + 1}');
final categories_ =
categoryNames ?? List.generate(categories, (i) => 'Cat ${i + 1}');
return categories_.map((category) {
final Map<String, dynamic> data = {'category': category};
for (final s in series) {
data[s] = _random.uniform(minValue, maxValue);
}
return data;
}).toList();
}