From a9c0b69a11254419a60ba267b83bbabc6a979a66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radek=20Pu=C5=A1?= <pusradek@fit.cvut.cz> Date: Thu, 16 Jan 2020 03:16:34 +0100 Subject: [PATCH] fix: weekdays avverage was not computed correctly --- Core/Core/ClientApp/src/app/home/home.service.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Core/Core/ClientApp/src/app/home/home.service.ts b/Core/Core/ClientApp/src/app/home/home.service.ts index b44be94..6a39750 100644 --- a/Core/Core/ClientApp/src/app/home/home.service.ts +++ b/Core/Core/ClientApp/src/app/home/home.service.ts @@ -59,8 +59,6 @@ export class HomeService { this.HomeChartDefinitionsService.ForecastAmountComparsionSizePieData = new Array<{ name: string, y: number }>(); } else { - console.log("res: ", res); - this.HomeChartDefinitionsService.ForecastTypes = this.MakePieChartData(res.neuralPredictionSizeTypes); this.NeuralNetworkTableDataSource.data = this.MakeMatTableData(res.neuralPrediction); @@ -125,11 +123,13 @@ export class HomeService { input.forEach(x => { for (let i: number = 0; i < 7; i++) { - weekDaysData[i].amount += x[i].amount / 7.0; + weekDaysData[i].amount += x[i].amount; weekDaysData[i].count += x[i].count; } }); + weekDaysData.forEach(x => { x.amount /= 4.0; x.count /= 4.0 }) + return this.MakePieChartData(weekDaysData as ITransaction[]); } -- GitLab