Skip to content
Snippets Groups Projects
Commit a9c0b69a authored by Radek Puš's avatar Radek Puš
Browse files

fix: weekdays avverage was not computed correctly

parent 48a9a727
No related branches found
No related tags found
No related merge requests found
......@@ -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[]);
}
 
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment