Distinct all time overview vs campaign overview

pull/43/head
HardiReady 2018-07-18 20:05:06 +02:00
parent 2b824bac7c
commit 14901883e6
1 changed files with 3 additions and 2 deletions

View File

@ -36,7 +36,7 @@ export class StatisticOverviewComponent implements OnInit {
showYAxisLabel = true; showYAxisLabel = true;
yAxisLabel = ''; yAxisLabel = '';
autoscale = true; autoscale = true;
timeline = true; timeline = false;
constructor(private route: ActivatedRoute, constructor(private route: ActivatedRoute,
private campaignService: CampaignService) { private campaignService: CampaignService) {
@ -66,6 +66,7 @@ export class StatisticOverviewComponent implements OnInit {
itemsProcessed++; itemsProcessed++;
if (itemsProcessed === campaigns.length) { if (itemsProcessed === campaigns.length) {
if (this.id === 'all') { if (this.id === 'all') {
this.timeline = true;
this.title = 'Gesamtübersicht'; this.title = 'Gesamtübersicht';
wars.sort((a, b) => { wars.sort((a, b) => {
// sort by dates, because older campaign can contain newer war // sort by dates, because older campaign can contain newer war
@ -110,7 +111,7 @@ export class StatisticOverviewComponent implements OnInit {
for (let i = wars.length - 1; i >= 0; i--) { for (let i = wars.length - 1; i >= 0; i--) {
const j = wars.length - i - 1; const j = wars.length - i - 1;
const warDate = new Date(wars[i].date); const warDate = (this.id === 'all') ? new Date(wars[i].date) : ChartUtils.getShortDateString(wars[i].date);
pointsObj[0].series.push({ pointsObj[0].series.push({
name: warDate, name: warDate,