From dfb8985e2fa2a32ddf3d88f7ba846420f8252ea5 Mon Sep 17 00:00:00 2001 From: HardiReady Date: Sun, 17 Feb 2019 20:25:57 +0100 Subject: [PATCH] Improve chart labels for flag chart (CC-72) --- .../war/fraction-stats/fraction-stats.component.html | 1 + .../war/fraction-stats/fraction-stats.component.ts | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/static/src/app/statistic/war/fraction-stats/fraction-stats.component.html b/static/src/app/statistic/war/fraction-stats/fraction-stats.component.html index c171625..498b206 100644 --- a/static/src/app/statistic/war/fraction-stats/fraction-stats.component.html +++ b/static/src/app/statistic/war/fraction-stats/fraction-stats.component.html @@ -37,6 +37,7 @@ [legendTitle]="legendTitle" [showXAxisLabel]="showXAxisLabel" [showYAxisLabel]="showYAxisLabel" + [yAxisLabel]="chartYAxisLabel" [animations]="barAnimations" [barPadding]="barPadding" [xAxisTickFormatting]="axisFormatX" diff --git a/static/src/app/statistic/war/fraction-stats/fraction-stats.component.ts b/static/src/app/statistic/war/fraction-stats/fraction-stats.component.ts index a2fc238..bbe213e 100644 --- a/static/src/app/statistic/war/fraction-stats/fraction-stats.component.ts +++ b/static/src/app/statistic/war/fraction-stats/fraction-stats.component.ts @@ -134,9 +134,9 @@ export class FractionStatsComponent implements OnInit, OnChanges { selectChart(newSelection) { this.activeChartSelect = newSelection; + this.setChartYAxisLabel(this.activeChartSelect); if (this.activeChartSelect !== this.labels.flag) { this.showLineChart = true; - this.setChartYAxisLabel(this.activeChartSelect); switch (this.activeChartSelect) { case this.labels.points: this.lineChartData = this.tmpPointData; @@ -506,6 +506,12 @@ export class FractionStatsComponent implements OnInit, OnChanges { } axisFormatY(val) { + if (val === 1) { + return Fraction.BLUFOR; + } + if (val === -1) { + return Fraction.OPFOR; + } return ''; } }