Compare commits

..

No commits in common. "bacb350a180299fec8e277dc251f951276fe1c67" and "10d6f3078148251756f5eaca3441e032d4b980b4" have entirely different histories.

2 changed files with 25 additions and 6 deletions

View File

@ -1,7 +1,7 @@
.slide-chart-container { .slide-chart-container {
width: 90%; width: 90%;
min-width: 880px; min-width: 880px;
height: 650px; height: 750px;
margin: auto; margin: auto;
padding-left: 6%; padding-left: 6%;
} }

View File

@ -21,7 +21,9 @@ export class StatisticOverviewComponent {
pointSumData: any[] = []; pointSumData: any[] = [];
playerData: any[] = []; playerData: any[] = [];
colorScheme = { colorScheme = {
group: 'Ordinal',
domain: ['#0000FF', '#B22222'] domain: ['#0000FF', '#B22222']
}; };
gradient = false; gradient = false;
@ -55,6 +57,7 @@ export class StatisticOverviewComponent {
} }
initWars(campaigns) { initWars(campaigns) {
let wars = []; let wars = [];
let itemsProcessed = 0; let itemsProcessed = 0;
campaigns = campaigns.filter(campaign => this.id === 'all' || campaign._id === this.id); campaigns = campaigns.filter(campaign => this.id === 'all' || campaign._id === this.id);
@ -89,16 +92,32 @@ export class StatisticOverviewComponent {
"name": "CSAT", "name": "CSAT",
"series": [] "series": []
}]; }];
let pointsSumObj = JSON.parse(JSON.stringify(pointsObj)); let pointsSumObj = [
let playersObj = JSON.parse(JSON.stringify(pointsObj)); {
"name": "NATO",
"series": []
},
{
"name": "CSAT",
"series": []
}];
let playersObj = [
{
"name": "NATO",
"series": []
},
{
"name": "CSAT",
"series": []
}
];
for (let i = wars.length - 1; i >= 0; i--) { for (let i = wars.length - 1; i >= 0; i--) {
let j = wars.length - i - 1; let j = wars.length - i - 1;
// const warDateString = new Date(wars[i].date); TODO: use ngx-chart timeline // const warDateString = new Date(wars[i].date); TODO: use ngx-chart timeline
const isoDate = wars[i].date.slice(0, 10); const isoDate = wars[i].date.slice(0, 10);
const dayDate = parseInt(isoDate.slice(8, 10)) + 1; const dayDate = parseInt(isoDate.slice(8, 10)) + 1;
const warDateString = (dayDate < 10 ? "0" + dayDate : dayDate) + '.' const warDateString = (dayDate < 10 ? "0" + dayDate : dayDate) + '.'
+ isoDate.slice(5, 7) + '.' + isoDate.slice(2, 4); + isoDate.slice(5, 7) + '.' + isoDate.slice(0, 4);
pointsObj[0].series.push({ pointsObj[0].series.push({
name: warDateString, name: warDateString,
@ -133,7 +152,7 @@ export class StatisticOverviewComponent {
this.pointData = pointsObj; this.pointData = pointsObj;
this.pointSumData = pointsSumObj; this.pointSumData = pointsSumObj;
this.playerData = playersObj; this.playerData = playersObj;
Object.assign(this, [this.pointData, this.pointSumData, this.playerData]); Object.assign(this, [this.pointData, this.pointSumData, this.playerData])
} }
} }