[BUGFIX] stats typescript

This commit is contained in:
Marie Birner 2023-10-01 18:44:44 +02:00
parent 3b927a6372
commit a78539fc61

View File

@ -5,14 +5,8 @@ export interface Data {
km: number;
}
let data = [
{ date: new Date('2023-01-01'), km: 5 },
{ date: new Date('2023-02-01'), km: 24 },
{ date: new Date('2023-08-30'), km: 4000 },
];
if(sessionStorage.getItem('userStats')) {
data = JSON.parse(sessionStorage.getItem('userStats') as Data[]);
const data = JSON.parse(sessionStorage.getItem('userStats') || '{}') as Data[];
const margin = { top: 20, right: 20, bottom: 50, left: 50 };
const width: number = 960 - margin.left - margin.right;