Skip to content

Commit

Permalink
Linechart: jsonDecode tooltip before displaying (#4069)
Browse files Browse the repository at this point in the history
  • Loading branch information
ndonkoHenri authored Oct 17, 2024
1 parent e175c7f commit fc5584f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/flet/lib/src/controls/linechart.dart
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,9 @@ class _LineChartControlState extends State<LineChartControl> {
return touchedSpots.map((spot) {
var dp = viewModel.dataSeries[spot.barIndex]
.dataPoints[spot.spotIndex];
var tooltip = dp.tooltip ?? dp.y.toString();
var tooltip = dp.tooltip != null
? jsonDecode(dp.tooltip!)
: dp.y.toString();
var tooltipStyle = parseTextStyle(
Theme.of(context), dp.control, "tooltipStyle");
tooltipStyle ??= const TextStyle();
Expand Down

0 comments on commit fc5584f

Please sign in to comment.