mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 12:47:13 +01:00
Upgraded Chart.js to v4. Updated charts.
This commit is contained in:
parent
3823705fc6
commit
c1d3e9ec67
11 changed files with 113 additions and 174 deletions
|
|
@ -181,18 +181,18 @@ export function getDateArray(data, startDate, endDate, unit) {
|
|||
const n = diff(endDate, startDate) + 1;
|
||||
|
||||
function findData(t) {
|
||||
const x = data.find(e => {
|
||||
return normalize(getDateFromString(e.t)).getTime() === t.getTime();
|
||||
const d = data.find(({ x }) => {
|
||||
return normalize(getDateFromString(x)).getTime() === t.getTime();
|
||||
});
|
||||
|
||||
return x?.y || 0;
|
||||
return d?.y || 0;
|
||||
}
|
||||
|
||||
for (let i = 0; i < n; i++) {
|
||||
const t = normalize(add(startDate, i));
|
||||
const y = findData(t);
|
||||
|
||||
arr.push({ ...data[i], t, y });
|
||||
arr.push({ x: t, y });
|
||||
}
|
||||
|
||||
return arr;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue