From 8d98eec733034dc53992f9be936553fd16e0569f Mon Sep 17 00:00:00 2001 From: John Castronuovo Date: Fri, 22 Jan 2021 21:47:39 +0100 Subject: [PATCH] feat(bartooltip): add textspan children parameter for idsplaying more information on a bar chart tooltip --- lib/src/chart/bar_chart/bar_chart_data.dart | 9 +++++++-- lib/src/chart/bar_chart/bar_chart_painter.dart | 7 ++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/lib/src/chart/bar_chart/bar_chart_data.dart b/lib/src/chart/bar_chart/bar_chart_data.dart index fa9a973d7d..0414aafde7 100644 --- a/lib/src/chart/bar_chart/bar_chart_data.dart +++ b/lib/src/chart/bar_chart/bar_chart_data.dart @@ -768,16 +768,21 @@ class BarTooltipItem with EquatableMixin { /// TextStyle of the showing content. final TextStyle textStyle; + /// List for more flexibility in showing content. + final List children; + /// content of the tooltip, is a [text] String with a [textStyle]. - BarTooltipItem(String text, TextStyle textStyle) + BarTooltipItem(String text, TextStyle textStyle, [List children]) : text = text, - textStyle = textStyle; + textStyle = textStyle, + children = children; /// Used for equality check, see [EquatableMixin]. @override List get props => [ text, textStyle, + children, ]; } diff --git a/lib/src/chart/bar_chart/bar_chart_painter.dart b/lib/src/chart/bar_chart/bar_chart_painter.dart index 4c5efc2f54..36c0f85f09 100644 --- a/lib/src/chart/bar_chart/bar_chart_painter.dart +++ b/lib/src/chart/bar_chart/bar_chart_painter.dart @@ -510,7 +510,12 @@ class BarChartPainter extends AxisChartPainter with TouchHandler