Skip to content

Commit fc5584f

Browse files
authored
Linechart: jsonDecode tooltip before displaying (#4069)
1 parent e175c7f commit fc5584f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/flet/lib/src/controls/linechart.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,9 @@ class _LineChartControlState extends State<LineChartControl> {
356356
return touchedSpots.map((spot) {
357357
var dp = viewModel.dataSeries[spot.barIndex]
358358
.dataPoints[spot.spotIndex];
359-
var tooltip = dp.tooltip ?? dp.y.toString();
359+
var tooltip = dp.tooltip != null
360+
? jsonDecode(dp.tooltip!)
361+
: dp.y.toString();
360362
var tooltipStyle = parseTextStyle(
361363
Theme.of(context), dp.control, "tooltipStyle");
362364
tooltipStyle ??= const TextStyle();

0 commit comments

Comments
 (0)