Skip to content

Commit

Permalink
#230 - replace decimal numbers with integers at parking's page
Browse files Browse the repository at this point in the history
  • Loading branch information
mikolaj-jalocha committed Sep 25, 2024
1 parent 7663bf9 commit 5b79bfa
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions lib/features/parking_chart/widgets/chart_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import "package:fast_immutable_collections/fast_immutable_collections.dart";
import "package:fl_chart/fl_chart.dart";
import "package:flutter/material.dart";

import "../../../theme/app_theme.dart";
import "../../parkings_view/models/parking.dart";
import "../chart_elements/chart_border.dart";
import "../chart_elements/chart_grid.dart";
Expand Down Expand Up @@ -39,6 +40,22 @@ class ChartWidget extends StatelessWidget {
maxX: chartData.maxX,
maxY: chartData.maxY(parking),
minY: 0,
lineTouchData:
LineTouchData(touchTooltipData: LineTouchTooltipData(
getTooltipItems: (touchedSpots) {
return touchedSpots.map((touchedSpot) {
final value =
touchedSpot.y.toInt(); // Convert double to int
return LineTooltipItem(
value.toString(),
TextStyle(
color: context.colorTheme.whiteSoap,
fontWeight: FontWeight.bold,
),
);
}).toList();
},
),),
),
),
),
Expand Down

0 comments on commit 5b79bfa

Please sign in to comment.