Improve chart labels for flag chart (CC-72)

pull/55/head
HardiReady 2019-02-17 20:25:57 +01:00
parent b6deb56fc0
commit dfb8985e2f
2 changed files with 8 additions and 1 deletions

View File

@ -37,6 +37,7 @@
[legendTitle]="legendTitle"
[showXAxisLabel]="showXAxisLabel"
[showYAxisLabel]="showYAxisLabel"
[yAxisLabel]="chartYAxisLabel"
[animations]="barAnimations"
[barPadding]="barPadding"
[xAxisTickFormatting]="axisFormatX"

View File

@ -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 '';
}
}