diff --git a/static/package.json b/static/package.json index bdbb911..d26329b 100644 --- a/static/package.json +++ b/static/package.json @@ -22,7 +22,7 @@ "@angular/platform-browser": "^4.3.2", "@angular/platform-browser-dynamic": "^4.3.2", "@angular/router": "^4.3.2", - "@swimlane/ngx-charts": "^6.0.1", + "@swimlane/ngx-charts": "^6.0.2", "@swimlane/ngx-datatable": "^10.2.3", "bootstrap": "^3.3.7", "core-js": "^2.4.1", diff --git a/static/src/app/statistic/overview/stats-overview.component.css b/static/src/app/statistic/overview/stats-overview.component.css index 9f8b169..96ae96f 100644 --- a/static/src/app/statistic/overview/stats-overview.component.css +++ b/static/src/app/statistic/overview/stats-overview.component.css @@ -1,7 +1,13 @@ .slide-chart-container { - width: 1200px; + width: 90%; + min-width: 880px; + height: 750px; margin: auto; - padding-left: 90px; + padding-left: 6%; +} + +:host /deep/ .carousel-indicators { + display: none; } :host /deep/ .carousel-control { @@ -9,16 +15,17 @@ cursor: pointer; } -:host /deep/ .chart-legend{ +:host /deep/ .chart-legend { position: absolute; margin-top: -60px; margin-left: -220px; } -:host /deep/ .legend-label { - float: left; +:host /deep/ .chart-legend .legend-labels { + width: 200px; } :host /deep/ .chart-legend .legend-label { + float: left; padding-left: 14px; } diff --git a/static/src/app/statistic/overview/stats-overview.component.html b/static/src/app/statistic/overview/stats-overview.component.html index 3db46c1..cff395c 100644 --- a/static/src/app/statistic/overview/stats-overview.component.html +++ b/static/src/app/statistic/overview/stats-overview.component.html @@ -10,23 +10,25 @@ (click)="goToSlide(1)">Spielerzahlen + +

Gesamtpunktzahl

+ [autoScale]="autoscale" + [timeline]="timeline">
@@ -34,18 +36,18 @@

Punkte je Schlacht

+ [autoScale]="autoscale" + [timeline]="timeline">>
@@ -53,18 +55,18 @@

Spielerzahlen

+ [autoScale]="autoscale" + [timeline]="timeline">
diff --git a/static/src/app/statistic/overview/stats-overview.component.ts b/static/src/app/statistic/overview/stats-overview.component.ts index ca737fc..4ea22b9 100644 --- a/static/src/app/statistic/overview/stats-overview.component.ts +++ b/static/src/app/statistic/overview/stats-overview.component.ts @@ -21,9 +21,21 @@ export class StatisticOverviewComponent { pointSumData: any[] = []; playerData: any[] = []; + colorScheme = { + group: 'Ordinal', domain: ['#0000FF', '#B22222'] }; + gradient = false; + xAxis = true; + yAxis = true; + roundDomains = true; + legend = true; + legendTitle = ''; + showXAxisLabel = true; + showYAxisLabel = true; + autoscale = true; + timeline = false; constructor(private route: ActivatedRoute, private campaignService: CampaignService) { @@ -101,6 +113,7 @@ export class StatisticOverviewComponent { ]; 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 const isoDate = wars[i].date.slice(0, 10); const dayDate = parseInt(isoDate.slice(8, 10)) + 1; const warDateString = (dayDate < 10 ? "0" + dayDate : dayDate) + '.'