drawBars method
void
drawBars()
Implementation
void drawBars(
Canvas canvas,
Size size,
List<List<int>> values,
List<List<Offset>> xPoints,
List<List<Offset>> yPoints,
List<int> yValues) {
double barWidth = 20;
for (int j = 0; j < names.length; j++) {
for (int i = 0; i < values[j].length; i++) {
var value = values[j][i];
var pos = yValues.indexOf(value);
final paint = Paint()
..color = colors[j].withOpacity(0.4)
..style = PaintingStyle.fill;
canvas.drawRect(
Rect.fromLTWH(xPoints[i][2].dx - barWidth / 2, yPoints[pos][2].dy,
barWidth, size.height - 30 - yPoints[pos][2].dy),
paint,
);
}
}
}