PhilippVogel92 / StudentTimer

A react native app with backend which allows students to track their learing time.
0 stars 0 forks source link

Logik für Statistiken berechnen und an einem Endpunkt zur Verfügung stellen #74

Closed carlobeckmann2602 closed 6 months ago

carlobeckmann2602 commented 9 months ago

Für den Endpunkt benötige ich ein Array aus verschiedenen Chart Objekten.

Chart Objects

H-Bar Chart

{   type: “hBar”   title: string,   xTotal: number,   bars: [     {       name?: string,       value: number,       color: string,       unit?: string,       average?: bool,     },     …   ] }

V-Bar Chart

{   type: “vBar”   title: string,   yTotal: number,   bars: [     {       name?: string,       value: number,       color: string,     },     …   ],   avgBars: [     {       value: number,       color: string,       unit?: string,       average?: bool,     },     …   ] }

V-Line Chart

{   type: “vLine”   title: string,   yTotal: number,   xTotal: number,   color: string,   labelColor: string,   values: [     {       x: number,       y: number,     },     …   ],   xDiscriptions: [     {       name: string       x: number     },     …   ] }

Star Chart

{   type: “stars”   title: string,   starValues: [     {       name: string,       value: number (0-5),       color: string     },     …   ] }

carlobeckmann2602 commented 9 months ago

TODO! Ändere Title in zu Performance auf dem dann unterschiedliche Sätze angezeigt werden

carlobeckmann2602 commented 7 months ago

Dummy Data für Statistiken

const dummyDataHBar: HBarChartProps = { type: "hBar", title: "Letzte Woche lief das Lernen etwas besser. Behalte deinen Fokus bei.", xTotal: 8, bars: [ { name: "Diese Woche", value: 5, color: COLORTHEME.light.primary, unit: "Stunden", average: true, }, { name: "Letzte Woche", value: 8, color: COLORTHEME.light.grey3, unit: "Stunden", average: true, }, ], };

const dummyDataVBar: VBarChartProps = { type: "vBar", title: "Im letzten Monat hast du am Wochenende 100% mehr gearbeitet als unter der Woche.", yTotal: 9, bars: [ { name: "Mo", value: 4.2, color: COLORTHEME.light.grey3, }, { name: "Di", value: 3.5, color: COLORTHEME.light.grey3, }, { name: "Mi", value: 4.4, color: COLORTHEME.light.grey3, }, { name: "Do", value: 3.8, color: COLORTHEME.light.grey3, }, { name: "Fr", value: 4.1, color: COLORTHEME.light.grey3, }, { name: "Sa", value: 7.9, color: COLORTHEME.light.primary, }, { name: "So", value: 8.2, color: COLORTHEME.light.primary, }, ], avgBars: [ { value: 1, color: COLORTHEME.light.grey3, unit: "Stunden", average: true, }, { value: 8, color: COLORTHEME.light.primary, unit: "Stunden", average: true, }, ], };

const dummyDataVLine: VLineChartProps = { type: "vLine", title: "Im letzten Monat hast du zu 80% von 18 Uhr bis 23 Uhr gearbeitet.", yTotal: 10, xTotal: 24, color: COLORTHEME.light.primary, labelColor: COLORTHEME.light.grey3, values: [ { x: 0, y: 0, }, { x: 1, y: 0, }, { x: 2, y: 5, }, { x: 3, y: 3, }, { x: 4, y: 0, }, { x: 5, y: 0, }, { x: 6, y: 0, }, { x: 7, y: 0, }, { x: 8, y: 1, }, { x: 9, y: 0, }, { x: 10, y: 0, }, { x: 11, y: 0, }, { x: 12, y: 0, }, { x: 13, y: 0, }, { x: 14, y: 0, }, { x: 15, y: 10, }, { x: 16, y: 0, }, { x: 17, y: 0, }, { x: 18, y: 0, }, { x: 19, y: 0, }, { x: 20, y: 8, }, { x: 21, y: 0, }, { x: 22, y: 0, }, { x: 23, y: 0, }, { x: 24, y: 0, }, ], xDiscriptions: [ { name: "Morgens", x: 3, }, { name: "Mittags", x: 9, }, { name: "Abends", x: 15, }, { name: "Nachts", x: 21, }, ], };

const dummyDataStarChart: StarChartProps = { type: "stars", title: "Mit der Leistung von Mediengestaltung 2 bist du am zufriedensten.", stars: [ { name: "Datenbanksysteme 1", value: 3, color: "#476930" }, { name: "Mediengestaltung 2", value: 5, color: "#053F5C" }, { name: "Mathematik 2", value: 1, color: "#A8320A" }, ], };

const dummyData = [ dummyDataHBar, dummyDataVBar, dummyDataVLine, dummyDataStarChart, ];