Durchschnitt zum Graph hinzugefügt
This commit is contained in:
parent
1b56dd2650
commit
e5d8862ee7
1 changed files with 40 additions and 3 deletions
|
|
@ -256,12 +256,49 @@ Hintergasse © 2026
|
|||
<script>
|
||||
|
||||
const history = {{ balance_history|tojson }};
|
||||
const currentPeriod = history.current || [];
|
||||
|
||||
const labels = Array.from(
|
||||
{ length: 31 },
|
||||
(_, i) => i + 1
|
||||
const labels = currentPeriod.map(item => {
|
||||
|
||||
const today = new Date();
|
||||
|
||||
let month = today.getMonth();
|
||||
let year = today.getFullYear();
|
||||
|
||||
if (today.getDate() < 15) {
|
||||
|
||||
month--;
|
||||
|
||||
if (month < 0) {
|
||||
month = 11;
|
||||
year--;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const startDate = new Date(
|
||||
year,
|
||||
month,
|
||||
15
|
||||
);
|
||||
|
||||
startDate.setDate(
|
||||
startDate.getDate() + item.day - 1
|
||||
);
|
||||
|
||||
return startDate.toLocaleDateString(
|
||||
"de-DE",
|
||||
{
|
||||
day: "2-digit",
|
||||
month: "2-digit",
|
||||
year: "numeric"
|
||||
}
|
||||
);
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
function getSeries(periodName) {
|
||||
|
||||
const values = new Array(31).fill(null);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue