Skip to content

Commit

Permalink
[#146] [RF] Improve Forecast Chart. Fix x-labels
Browse files Browse the repository at this point in the history
  • Loading branch information
lyskouski committed Aug 19, 2023
1 parent ea79758 commit 252ee35
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/charts/painter/foreground_chart_painter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,7 @@ class ForegroundChartPainter extends CustomPainter {
textDirection: TextDirection.ltr,
);
textPainter.layout();
final offset = Offset(
x - textPainter.width,
y,
);
textPainter.paint(canvas, offset);
textPainter.paint(canvas, Offset(x - textPainter.width, y));
}

void _paintAxisY(Canvas canvas, Size size) {
Expand Down Expand Up @@ -142,7 +138,7 @@ class ForegroundChartPainter extends CustomPainter {
DateTime txt = DateTime.fromMillisecondsSinceEpoch((min + delta).toInt());
value = intl.DateFormat('d').format(txt);
}
_painText(canvas, x + shift / 2, height + 1, value.toString());
_painText(canvas, x + shift - 2, height + 1, value.toString());
}
if (i % 2 != 0) {
canvas.drawRect(
Expand Down

0 comments on commit 252ee35

Please sign in to comment.