fix(graphs): correct tooltip text
This commit is contained in:
parent
1c4bc48e6f
commit
512de4deff
1 changed files with 33 additions and 16 deletions
|
@ -51,22 +51,39 @@ class ExpensesLineChart extends StatelessWidget {
|
||||||
getTooltipItems: (spots) => List<LineTooltipItem>.generate(
|
getTooltipItems: (spots) => List<LineTooltipItem>.generate(
|
||||||
spots.length,
|
spots.length,
|
||||||
(index) => LineTooltipItem(
|
(index) => LineTooltipItem(
|
||||||
(yearly)
|
(spots[index].barIndex == 0)
|
||||||
? AppLocalizations.of(context).expensesForMonth(
|
? (yearly
|
||||||
DateFormat.MMMM(locale).format(
|
? AppLocalizations.of(context).incomeForMonth(
|
||||||
DateTime(date.year, spots[index].x.toInt() + 1, 1)),
|
DateFormat.MMMM(locale).format(DateTime(
|
||||||
NumberFormat.compactCurrency(
|
date.year, spots[index].x.toInt() + 1, 1)),
|
||||||
locale: locale,
|
NumberFormat.compactCurrency(
|
||||||
symbol: currency.symbol,
|
locale: locale,
|
||||||
name: currency.name)
|
symbol: currency.symbol,
|
||||||
.format(spots[index].y))
|
name: currency.name)
|
||||||
: AppLocalizations.of(context).expensesForDay(
|
.format(spots[index].y))
|
||||||
NumberFormat.compactCurrency(
|
: AppLocalizations.of(context).incomeForDay(
|
||||||
locale: locale,
|
NumberFormat.compactCurrency(
|
||||||
symbol: currency.symbol,
|
locale: locale,
|
||||||
name: currency.name)
|
symbol: currency.symbol,
|
||||||
.format(spots[index].y),
|
name: currency.name)
|
||||||
),
|
.format(spots[index].y),
|
||||||
|
))
|
||||||
|
: (yearly
|
||||||
|
? AppLocalizations.of(context).expensesForMonth(
|
||||||
|
DateFormat.MMMM(locale).format(DateTime(
|
||||||
|
date.year, spots[index].x.toInt() + 1, 1)),
|
||||||
|
NumberFormat.compactCurrency(
|
||||||
|
locale: locale,
|
||||||
|
symbol: currency.symbol,
|
||||||
|
name: currency.name)
|
||||||
|
.format(spots[index].y))
|
||||||
|
: AppLocalizations.of(context).expensesForDay(
|
||||||
|
NumberFormat.compactCurrency(
|
||||||
|
locale: locale,
|
||||||
|
symbol: currency.symbol,
|
||||||
|
name: currency.name)
|
||||||
|
.format(spots[index].y),
|
||||||
|
)),
|
||||||
TextStyle(color: spots[index].bar.color),
|
TextStyle(color: spots[index].bar.color),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
Loading…
Reference in a new issue