clone object on init
parent
10d6f30781
commit
7cf71e43a5
|
@ -21,9 +21,7 @@ export class StatisticOverviewComponent {
|
|||
pointSumData: any[] = [];
|
||||
playerData: any[] = [];
|
||||
|
||||
|
||||
colorScheme = {
|
||||
group: 'Ordinal',
|
||||
domain: ['#0000FF', '#B22222']
|
||||
};
|
||||
gradient = false;
|
||||
|
@ -57,7 +55,6 @@ export class StatisticOverviewComponent {
|
|||
}
|
||||
|
||||
initWars(campaigns) {
|
||||
|
||||
let wars = [];
|
||||
let itemsProcessed = 0;
|
||||
campaigns = campaigns.filter(campaign => this.id === 'all' || campaign._id === this.id);
|
||||
|
@ -92,25 +89,9 @@ export class StatisticOverviewComponent {
|
|||
"name": "CSAT",
|
||||
"series": []
|
||||
}];
|
||||
let pointsSumObj = [
|
||||
{
|
||||
"name": "NATO",
|
||||
"series": []
|
||||
},
|
||||
{
|
||||
"name": "CSAT",
|
||||
"series": []
|
||||
}];
|
||||
let playersObj = [
|
||||
{
|
||||
"name": "NATO",
|
||||
"series": []
|
||||
},
|
||||
{
|
||||
"name": "CSAT",
|
||||
"series": []
|
||||
}
|
||||
];
|
||||
let pointsSumObj = JSON.parse(JSON.stringify(pointsObj));
|
||||
let playersObj = JSON.parse(JSON.stringify(pointsObj));
|
||||
|
||||
for (let i = wars.length - 1; i >= 0; i--) {
|
||||
let j = wars.length - i - 1;
|
||||
// const warDateString = new Date(wars[i].date); TODO: use ngx-chart timeline
|
||||
|
@ -152,7 +133,7 @@ export class StatisticOverviewComponent {
|
|||
this.pointData = pointsObj;
|
||||
this.pointSumData = pointsSumObj;
|
||||
this.playerData = playersObj;
|
||||
Object.assign(this, [this.pointData, this.pointSumData, this.playerData])
|
||||
Object.assign(this, [this.pointData, this.pointSumData, this.playerData]);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue