Skip to content

Commit

Permalink
fix: hide empty expense / income groups in DistributionChart
Browse files Browse the repository at this point in the history
closes #28
  • Loading branch information
simonwep committed Dec 30, 2023
1 parent a2bc10a commit 55e85a4
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ const data = computed((): SankeyChartConfig => {
for (const group of state.income) {
const total = sum(group.budgets.flatMap((v) => v.values));
if (!total) {
continue;
}
labels.push({
id: group.id,
name: `${group.name} (${format(total)})`,
Expand Down Expand Up @@ -85,6 +89,11 @@ const data = computed((): SankeyChartConfig => {
for (const group of state.expenses) {
const total = sum(group.budgets.flatMap((v) => v.values));
if (!total) {
continue;
}
labels.push({
id: group.id,
name: `${group.name} (${format(total)})`,
Expand Down

0 comments on commit 55e85a4

Please sign in to comment.