fixes and such
This commit is contained in:
@ -9,50 +9,6 @@
|
||||
let budgets = $derived(data.budgets);
|
||||
let budgetTransactions = $derived(data.budgetTransactions);
|
||||
let last30days = $derived(data.last30DaysTransactionsSums.reverse());
|
||||
|
||||
let chartData = $derived(
|
||||
last30days.reduce(
|
||||
(acc, curr) => [...acc, acc[acc.length - 1] + Number(curr.sum)],
|
||||
[Number(total)]
|
||||
)
|
||||
);
|
||||
|
||||
let chartDates = $derived([
|
||||
'now',
|
||||
...last30days.map((day) => `${day.date.getMonth() + 1}/${day.date.getDate()}`)
|
||||
]);
|
||||
|
||||
const option = $derived({
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: chartDates
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
data: chartData,
|
||||
type: 'line',
|
||||
label: {
|
||||
show: false,
|
||||
position: 'top',
|
||||
formatter: (params) => {
|
||||
return `$${params.value.toFixed(2)}`;
|
||||
},
|
||||
fontSize: 20,
|
||||
padding: 10,
|
||||
backgroundColor: 'rgba(255, 255, 255, 0.8)',
|
||||
borderRadius: 5
|
||||
},
|
||||
emphasis: {
|
||||
label: {
|
||||
show: true // Labels appear on hover
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
</script>
|
||||
|
||||
<span class="font-sans text-xl"
|
||||
@ -61,8 +17,6 @@
|
||||
></span
|
||||
>
|
||||
|
||||
<div class="container" use:echarts={option} />
|
||||
|
||||
<div class="text-xl divider">Unallocated Transactions</div>
|
||||
<TransactionList {budgets} {budgetTransactions} transactions={unallocatedTrans} />
|
||||
|
||||
|
||||
Reference in New Issue
Block a user