Skip to content

Commit

Permalink
fix : label always inside chart
Browse files Browse the repository at this point in the history
  • Loading branch information
julien4215 authored and imaNNeo committed Mar 28, 2024
1 parent 2c7295b commit bf36544
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/src/chart/base/axis_chart/axis_chart_painter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ abstract class AxisChartPainter<D extends AxisChartData>
tp,
label.alignment.withinRect(
Rect.fromLTRB(
from.dx + padding.left,
from.dx + padding.left + tp.height,
from.dy - padding.bottom - tp.width,
to.dx - padding.right,
to.dy + padding.top,
Expand Down Expand Up @@ -422,7 +422,7 @@ abstract class AxisChartPainter<D extends AxisChartData>
from.dx - padding.right - tp.width,
from.dy + padding.top,
to.dx + padding.left,
to.dy - padding.bottom,
to.dy - padding.bottom - tp.height,
),
),
);
Expand Down
4 changes: 2 additions & 2 deletions test/chart/line_chart/line_chart_painter_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2372,8 +2372,8 @@ void main() {
final offset3 = result2.captured[0] as Offset;
final offset4 = result2.captured[1] as Offset;
expect(offset1, const Offset(6, 50));
expect(offset2, const Offset(36, 94));
expect(offset3, const Offset(6, -22));
expect(offset2, const Offset(36, 80));
expect(offset3, const Offset(20, -22));
expect(offset4, const Offset(80, 38));
});
});
Expand Down

0 comments on commit bf36544

Please sign in to comment.