From 0b899bf5b24c5216bb2aae47ef7355c1c124a6b7 Mon Sep 17 00:00:00 2001 From: Hagen <hagen.dressler@mni.thm.de> Date: Wed, 14 Mar 2018 11:32:53 +0100 Subject: [PATCH] Edit component answer-statistic (html/style) --- .../answer-statistics.component.html | 16 +++++++++++----- .../answer-statistics.component.scss | 4 ++-- .../answer-statistics.component.ts | 4 ++++ 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/app/answer-statistics/answer-statistics.component.html b/src/app/answer-statistics/answer-statistics.component.html index a8dd5151c..6fd636406 100644 --- a/src/app/answer-statistics/answer-statistics.component.html +++ b/src/app/answer-statistics/answer-statistics.component.html @@ -3,17 +3,23 @@ <mat-card> <mat-tab-group> <mat-tab label="Answer statistic"> - <mat-select placeholder="Answers" fxLayoutAlign="right"> + <mat-select placeholder="Answers" fxLayoutAlign="right" (change)="showStatistic($event.value)"> <mat-option *ngFor="let state of states" [value]="state.value"> - {{ state.value }} + {{ state.viewValue }} </mat-option> </mat-select> - <div class="bars"> - Answer 1 - <mat-progress-bar [value]="50" #col *ngIf="state.value === 'Responded' :"> + <div *ngIf="selected == 1"> + <!-- Add list of Question statistic --> + <mat-progress-bar [value]="50"> + </mat-progress-bar> + </div> + <div *ngIf="selected == 2"> + <!-- Add list of Question statistic --> + <mat-progress-bar [value]="50" color="warn"> </mat-progress-bar> </div> </mat-tab> + <!-- Add second tab with true false answers --> </mat-tab-group> </mat-card> </div> diff --git a/src/app/answer-statistics/answer-statistics.component.scss b/src/app/answer-statistics/answer-statistics.component.scss index 26bb809a0..dc1090888 100644 --- a/src/app/answer-statistics/answer-statistics.component.scss +++ b/src/app/answer-statistics/answer-statistics.component.scss @@ -4,9 +4,9 @@ mat-card { } mat-select { - max-width: 100px; + max-width: 150px; margin-top: 10px; - margin-left: 675px; + margin-left: 625px; } .bars { diff --git a/src/app/answer-statistics/answer-statistics.component.ts b/src/app/answer-statistics/answer-statistics.component.ts index 07af3178d..e52b560ac 100644 --- a/src/app/answer-statistics/answer-statistics.component.ts +++ b/src/app/answer-statistics/answer-statistics.component.ts @@ -10,10 +10,14 @@ export class AnswerStatisticsComponent implements OnInit { { value: '1', viewValue: 'Responded' }, { value: '2', viewValue: 'Not responded' }, ]; + selected: number = null; constructor() { } ngOnInit() { } + showStatistic(value) { + this.selected = value; + } } -- GitLab