Skip to content

Commit

Permalink
Improve tooltips in habit completion rate chart
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasn committed Dec 9, 2022
1 parent e2c810c commit d7fbb52
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed:
- Improved whitespace in habit success indicators
- Improved habit completion rate tooltips

## [0.8.204] - 2022-12-07
### Added:
Expand Down
22 changes: 22 additions & 0 deletions lib/widgets/charts/habits/habit_completion_rate_chart.dart
Expand Up @@ -62,6 +62,28 @@ class HabitCompletionRateChart extends StatelessWidget {
),
child: LineChart(
LineChartData(
lineTouchData: LineTouchData(
touchTooltipData: LineTouchTooltipData(
tooltipPadding: const EdgeInsets.symmetric(
horizontal: 8,
vertical: 4,
),
tooltipBgColor: styleConfig().primaryColor.withOpacity(0.8),
tooltipRoundedRadius: 4,
getTooltipItems: (List<LineBarSpot> spots) {
return spots.map((spot) {
return LineTooltipItem(
'${spot.y.toInt()} %',
const TextStyle(
fontSize: fontSizeMedium,
fontFamily: mainFont,
fontWeight: FontWeight.w300,
),
);
}).toList();
},
),
),
gridData: FlGridData(
show: true,
drawVerticalLine: true,
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
@@ -1,7 +1,7 @@
name: lotti
description: A Smart Journal.
publish_to: 'none'
version: 0.8.205+1599
version: 0.8.205+1600

msix_config:
display_name: Lotti
Expand Down

0 comments on commit d7fbb52

Please sign in to comment.