fix trends + stacked chart

This commit is contained in:
Emily
2024-10-15 13:30:36 +02:00
parent 00e63cc80b
commit a876d77d42
4 changed files with 21 additions and 11 deletions

View File

@@ -62,7 +62,7 @@ export function fixMetrics(result: { data: MetricsTimeline[], from: string, to:
const allKeys = !options.advanced ? [] : Array.from(new Set(result.data.map((e: any) => e[options.advancedGroupKey])).values());
console.log({allKeys})
console.log({ allKeys, allDates })
const fixed: any[] = allDates.map(matchDate => {
@@ -102,9 +102,9 @@ console.log({allKeys})
if (slice == 'hour') {
return `${e._id.getHours().toString().padStart(2, '0')}:00`
} else if (slice == 'day') {
return `${e._id.getDate().toString().padStart(2, '0')}/${e._id.getMonth().toString().padStart(2, '0')}`
return `${e._id.getDate().toString().padStart(2, '0')}/${(e._id.getMonth() + 1).toString().padStart(2, '0')}`
} else if (slice == 'month') {
return `${e._id.getMonth().toString().padStart(2, '0')}/${e._id.getFullYear().toString()}`
return `${(e._id.getMonth() + 1).toString().padStart(2, '0')}/${e._id.getFullYear().toString()}`
} else if (slice == 'year') {
return `${e._id.getFullYear().toString()}`
} else {