From 42d7d290adaff5ddd181691033fdd1eeb2eb8372 Mon Sep 17 00:00:00 2001 From: LondonTran Date: Sat, 17 Oct 2020 02:50:12 -0400 Subject: [PATCH] Override toString method for FlSpot. Allows printing of X and Y FlSpot coordinates instead of data type(FlSpot). - London Tran --- lib/src/chart/base/axis_chart/axis_chart_data.dart | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/src/chart/base/axis_chart/axis_chart_data.dart b/lib/src/chart/base/axis_chart/axis_chart_data.dart index 16b8dc8b3..9143c0165 100644 --- a/lib/src/chart/base/axis_chart/axis_chart_data.dart +++ b/lib/src/chart/base/axis_chart/axis_chart_data.dart @@ -351,6 +351,12 @@ class FlSpot with EquatableMixin { ); } + ///Prints x and y coordinates of FlSpot list + @override + String toString() { + return '(' + x.toString() + ', ' + y.toString() + ')'; + } + /// Used for splitting lines, or maybe other concepts. static FlSpot nullSpot = FlSpot(null, null);