Spielerzahlen
+
-
-
-
-
Gesamtpunktzahl
-
-
-
-
-
-
-
Punkte je Schlacht
- >
-
-
-
-
-
-
Spielerzahlen
-
-
-
-
-
diff --git a/static/src/app/statistic/overview/stats-overview.component.ts b/static/src/app/statistic/overview/stats-overview.component.ts
index 0a01419..a390b79 100644
--- a/static/src/app/statistic/overview/stats-overview.component.ts
+++ b/static/src/app/statistic/overview/stats-overview.component.ts
@@ -16,11 +16,12 @@ export class StatisticOverviewComponent {
id = "";
title = "";
- activeSlideIndex: number = 0;
pointData: any[] = [];
pointSumData: any[] = [];
playerData: any[] = [];
+ currentData : any[];
+ activeSlideIndex;
colorScheme = {
domain: ['#0000FF', '#B22222']
@@ -33,9 +34,11 @@ export class StatisticOverviewComponent {
legendTitle = '';
showXAxisLabel = true;
showYAxisLabel = true;
+ yAxisLabel = "";
autoscale = true;
timeline = false;
+
constructor(private route: ActivatedRoute,
private campaignService: CampaignService) {
}
@@ -63,10 +66,7 @@ export class StatisticOverviewComponent {
if (this.id === 'all') {
this.title = "Gesamtübersicht";
} else {
- this.title = campaign.title
- setTimeout(() => {
- this.activeSlideIndex = 2;
- }, 10)
+ this.title = campaign.title;
}
wars = wars.concat(campaign.wars);
itemsProcessed++;
@@ -77,7 +77,13 @@ export class StatisticOverviewComponent {
}
goToSlide(index: number) {
+ switch (index) {
+ case 0: this.currentData = this.pointSumData; this.yAxisLabel="Gesamtpunkte"; break;
+ case 1: this.currentData = this.pointData; this.yAxisLabel="Punkte"; break;
+ case 2: this.currentData = this.playerData; this.yAxisLabel="Anzahl Spieler"; break;
+ }
this.activeSlideIndex = index;
+
}
initChart(wars: any[]) {
@@ -130,7 +136,12 @@ export class StatisticOverviewComponent {
this.pointData = pointsObj;
this.pointSumData = pointsSumObj;
this.playerData = playersObj;
- Object.assign(this, [this.pointData, this.pointSumData, this.playerData]);
+ if (this.id != 'all') {
+ this.goToSlide(0);
+ } else {
+ this.goToSlide(1);
+ }
+ Object.assign(this, this.currentData);
}
}
diff --git a/static/src/app/statistic/war-list/war-item.component.html b/static/src/app/statistic/war-list/war-item.component.html
index dd962b5..85ca722 100644
--- a/static/src/app/statistic/war-list/war-item.component.html
+++ b/static/src/app/statistic/war-list/war-item.component.html
@@ -3,7 +3,7 @@
- {{war.title}}
+ {{war.title}}
vom {{war.date | date: 'dd.MM.yyyy'}}
diff --git a/static/src/app/statistic/war-list/war-list.component.html b/static/src/app/statistic/war-list/war-list.component.html
index 1373b04..eee2b9f 100644
--- a/static/src/app/statistic/war-list/war-list.component.html
+++ b/static/src/app/statistic/war-list/war-list.component.html
@@ -25,7 +25,7 @@
@@ -47,7 +47,7 @@