randomDataYs function

List<List<double>> randomDataYs(
  1. int numXLabels,
  2. int _numDataRows,
  3. bool _overlapDataYs
)

Implementation

List<List<double>> randomDataYs(int numXLabels, int _numDataRows, bool _overlapDataYs) {
  List<List<double>> dataRows = List.empty(growable: true);

  double scale = 200.0;

  math.Random rgen = math.Random();

  int maxDataY = 4;
  double pushUpStep = _overlapDataYs ? 0.0 : maxDataY.toDouble();

  for (int rowIndex = 0; rowIndex < _numDataRows; rowIndex++) {
    dataRows.add(_randomDataOneRow(
      rgen: rgen,
      max: maxDataY,
      pushUpBy: (rowIndex - 1) * pushUpStep,
      scale: scale,
      numXLabels: numXLabels,
    ));
  }
  return dataRows;
}