feat(networth): show all chart data points when clicking on account or currency card title

This commit is contained in:
Herculino Trotta
2024-12-14 02:49:09 -03:00
parent 216f9b8ef4
commit b744aed388

View File

@@ -20,7 +20,16 @@
<i class="fa-solid fa-coins"></i>
</div>
<div class="card-body">
<h5 class="tw-text-yellow-400 fw-bold mb-3">{% translate 'By currency' %}</h5>
<h5 class="tw-text-yellow-400 fw-bold mb-3"
_="on click
set chart to Chart.getChart('currencyBalanceChart')
for dataset in chart.data.datasets
call chart.setDatasetVisibility(chart.data.datasets.indexOf(dataset), true)
end
call chart.update()
end">
{% translate 'By currency' %}
</h5>
{% for currency in currency_net_worth.values %}
<div class="d-flex justify-content-between mt-2">
<div class="d-flex align-items-baseline w-100">
@@ -73,7 +82,16 @@
<i class="fa-solid fa-wallet"></i>
</div>
<div class="card-body">
<h5 class="tw-text-blue-400 fw-bold mb-3">{% translate 'By account' %}</h5>
<h5 class="tw-text-blue-400 fw-bold mb-3"
_="on click
set chart to Chart.getChart('accountBalanceChart')
for dataset in chart.data.datasets
call chart.setDatasetVisibility(chart.data.datasets.indexOf(dataset), true)
end
call chart.update()
end">
{% translate 'By account' %}
</h5>
{% regroup account_net_worth.values by account.group as account_data %}
{% for data in account_data %}
{% if data.grouper %}