Update alltime stats to use timeline (CC-47)

pull/43/head
HardiReady 2018-07-18 19:55:22 +02:00
parent e218076ae3
commit 2b824bac7c
1 changed files with 7 additions and 8 deletions

View File

@ -110,34 +110,34 @@ export class StatisticOverviewComponent implements OnInit {
for (let i = wars.length - 1; i >= 0; i--) {
const j = wars.length - i - 1;
const warDateString = new Date(wars[i].date);
const warDate = new Date(wars[i].date);
pointsObj[0].series.push({
name: warDateString,
name: warDate,
value: wars[i].ptBlufor
});
pointsObj[1].series.push({
name: warDateString,
name: warDate,
value: wars[i].ptOpfor
});
pointsSumObj[0].series.push({
name: warDateString,
name: warDate,
value: pointsSumObj[0].series[j - 1] ?
pointsSumObj[0].series[j - 1].value + wars[i].ptBlufor :
wars[i].ptBlufor
});
pointsSumObj[1].series.push({
name: warDateString,
name: warDate,
value: pointsSumObj[1].series[j - 1]
? pointsSumObj[1].series[j - 1].value + wars[i].ptOpfor :
wars[i].ptOpfor
});
playersObj[0].series.push({
name: warDateString,
name: warDate,
value: wars[i].playersBlufor
});
playersObj[1].series.push({
name: warDateString,
name: warDate,
value: wars[i].playersOpfor
});
}
@ -156,5 +156,4 @@ export class StatisticOverviewComponent implements OnInit {
isActiveSlide(index) {
return this.activeSlideIndex === index ? '#d9edf7' : 'white';
}
}