chartColorFromId static method

Color chartColorFromId(
  1. int id
)

Implementation

static charts.Color chartColorFromId(int id) {
  if (id == 0) {
    return charts.MaterialPalette.blue.shadeDefault;
  } else if (id == 1) {
    return charts.MaterialPalette.red.shadeDefault;
  } else if (id == 2) {
    return charts.MaterialPalette.green.shadeDefault;
  } else if (id == 3) {
    return charts.MaterialPalette.purple.shadeDefault;
  } else if (id == 4) {
    return charts.MaterialPalette.yellow.shadeDefault;
  }

  throw Exception("Invalid id");
}