feat: add graphs #16
1 changed files with 33 additions and 16 deletions
|
@ -51,10 +51,27 @@ class ExpensesLineChart extends StatelessWidget {
|
|||
getTooltipItems: (spots) => List<LineTooltipItem>.generate(
|
||||
spots.length,
|
||||
(index) => LineTooltipItem(
|
||||
(yearly)
|
||||
(spots[index].barIndex == 0)
|
||||
? (yearly
|
||||
? AppLocalizations.of(context).incomeForMonth(
|
||||
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).incomeForDay(
|
||||
NumberFormat.compactCurrency(
|
||||
locale: locale,
|
||||
symbol: currency.symbol,
|
||||
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)),
|
||||
DateFormat.MMMM(locale).format(DateTime(
|
||||
date.year, spots[index].x.toInt() + 1, 1)),
|
||||
NumberFormat.compactCurrency(
|
||||
locale: locale,
|
||||
symbol: currency.symbol,
|
||||
|
@ -66,7 +83,7 @@ class ExpensesLineChart extends StatelessWidget {
|
|||
symbol: currency.symbol,
|
||||
name: currency.name)
|
||||
.format(spots[index].y),
|
||||
),
|
||||
)),
|
||||
TextStyle(color: spots[index].bar.color),
|
||||
),
|
||||
),
|
||||
|
|
Loading…
Reference in a new issue