Skip to content

Commit

Permalink
enabled charts repainting (#16)
Browse files Browse the repository at this point in the history
* enabled pie chart repaint

* enabled all charts to repaint if data is changed
  • Loading branch information
erolasan authored and imaNNeo committed Jun 9, 2019
1 parent fae18a1 commit 46d978b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion lib/src/chart/bar_chart/bar_chart_painter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -272,5 +272,6 @@ class BarChartPainter extends AxisChartPainter {
}

@override
bool shouldRepaint(CustomPainter oldDelegate) => false;
bool shouldRepaint(BarChartPainter oldDelegate) =>
oldDelegate.data != this.data;
}
3 changes: 2 additions & 1 deletion lib/src/chart/line_chart/line_chart_painter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -360,5 +360,6 @@ class LineChartPainter extends AxisChartPainter {
}

@override
bool shouldRepaint(CustomPainter oldDelegate) => false;
bool shouldRepaint(LineChartPainter oldDelegate) =>
oldDelegate.data != this.data;
}
4 changes: 2 additions & 2 deletions lib/src/chart/pie_chart/pie_chart_painter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,6 @@ class PieChartPainter extends BaseChartPainter {
}

@override
bool shouldRepaint(CustomPainter oldDelegate) => false;

bool shouldRepaint(PieChartPainter oldDelegate) =>
oldDelegate.data != this.data;
}

0 comments on commit 46d978b

Please sign in to comment.