lineData method

List<Map<String, dynamic>> lineData({
  1. int points = 20,
  2. double startValue = 50,
  3. double volatility = 5,
  4. String xKey = 'x',
  5. String yKey = 'y',
})

Generates line chart data.

Implementation

List<Map<String, dynamic>> lineData({
  int points = 20,
  double startValue = 50,
  double volatility = 5,
  String xKey = 'x',
  String yKey = 'y',
}) {
  final values =
      _random.randomWalk(points, start: startValue, stepSize: volatility);
  return List.generate(points, (i) => {xKey: i, yKey: values[i]});
}