report-all-stat.ts 23 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import { Component, OnInit, OnDestroy, ElementRef, ViewChild, Input } from "@angular/core";
import { Injectable } from "@angular/core";
import { AppSettings } from '../../app.settings';
import { HelperDataService } from '../../services/helper-data-service';
import { Observable} from "rxjs/Observable";
import { Http, Headers, RequestOptions} from '@angular/http';
import { NgRedux, select } from 'ng2-redux';
import { IAppState } from '../../store/store';
import { Router, ActivatedRoute, Params} from '@angular/router';
import { BehaviorSubject, Subscription } from 'rxjs/Rx';
import { ILoginInfo } from '../../store/logininfo/logininfo.types';
import { Ng2SmartTableModule, LocalDataSource } from 'ng2-smart-table';
import {reportsSchema, TableColumn} from './reports-schema';
import { LOGININFO_INITIAL_STATE } from '../../store/logininfo/logininfo.initial-state';
15
import { PDE_ROLE, DIDE_ROLE } from '../../constants';
16
import {csvCreator} from './csv-creator';
17
import {chartCreator} from './chart-creator';
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

import {
    FormBuilder,
    FormGroup,
    FormControl,
    FormArray,
    Validators,
} from '@angular/forms';


import { API_ENDPOINT } from '../../app.settings';

@Component({
    selector: 'report-all-stat',
    template: `

  <div>

36

37
38
39
40
41
42
        <div
          class = "loading" *ngIf="validCreator == 0" >
        </div>

        <form [formGroup]="formGroup"  #form>

43
44
45
46
47
          <!--<h5> >Επιλογή Φίλτρων <br><br></h5>-->
          <br>
          <button type="button" class="btn-link" (click)="toggleRegionFilter()" >
              > Φίλτρο Επιλογής Περιφ/κής Δ/νσης - Δ/νσης Εκπ/σης - Σχολείου
          </button>
48
          <div  class="col-md-11 offset-md-1">
49
50
                <label *ngIf = "enableRegionFilter && userLoggedIn == 'supervisor'"> Περιφερειακή Διεύθυνση </label>
                <select #regsel class="form-control" (change)="checkregion(regsel)" *ngIf = "enableRegionFilter" [value] = "regionSelected" [hidden] = "userLoggedIn != 'supervisor'" formControlName="region">
51
                  <option value="0"></option>
52
                  <option *ngFor="let RegionSelection$  of RegionSelections$ | async; let i=index" [value] = "RegionSelection$.id"> {{RegionSelection$.name}} </option>
53
54
                </select>
          </div>
55
          <div class="col-md-11 offset-md-1">
56
57
                <label *ngIf="(showAdminList | async) && enableRegionFilter && userLoggedIn != 'dide'">Διεύθυνση Εκπαίδευσης</label>
                <select #admsel class="form-control"  *ngIf="(showAdminList | async) && enableRegionFilter" (change)="checkadminarea(admsel)" [hidden] = "userLoggedIn == 'dide'" formControlName="adminarea">
58
                  <option value="0"></option>
59
60
61
                  <option *ngFor="let AdminAreaSelection$  of AdminAreaSelections$ | async; let i=index" [value] = "AdminAreaSelection$.id"> {{AdminAreaSelection$.name}}</option>
                </select>
          </div>
62
          <div class="col-md-11 offset-md-1">
63
64
                <label *ngIf="(showAdminList | async) && enableRegionFilter">Σχολείο</label>
                <select #schsel class="form-control"  *ngIf="(showAdminList | async) && enableRegionFilter" (change)="checkschool(schsel)" formControlName="schoollist">
65
                  <option value="0"></option>
66
67
68
                  <option *ngFor="let SchoolSelection$  of SchoolSelections$ | async; let i=index" [value] = "SchoolSelection$.epal_id"> {{SchoolSelection$.epal_name}} </option>
                </select>
          </div>
69
70
71
72

          <button type="button" class="btn-link" (click)="toggleCourseFilter()" *ngIf = "reportId == 3" >
              > Φίλτρο Επιλογής Τομέα / Ειδικότητας
          </button>
73
          <br>
74
75
76
77
78
79
80
          <div  class="col-md-11 offset-md-1">
                <label for="classid" *ngIf = "enableCourseFilter" >Τάξη</label><br/>
                <select #class_sel  class="form-control" (change)="checkclass(class_sel)" *ngIf = "enableCourseFilter" formControlName="classid" >
                  <option value="0" ></option>
                  <option value="1" >Α' Λυκείου</option>
                  <option value="2" >Β' Λυκείου</option>
                  <option value="3" >Γ' Λυκείου</option>
81
                  <option value="4" >Δ' Λυκείου</option>
82
83
84
                </select>
          </div>
          <div class="col-md-11 offset-md-1">
85
86
87
                <label *ngIf="(showSectorList | async) && enableCourseFilter && (classSelected == 2 || classSelected == 3 || classSelected == 4) ">Τομέας</label>
                <select #secsel class="form-control"  *ngIf="(showSectorList | async) && enableCourseFilter && (classSelected == 2 || classSelected == 3 || classSelected == 4)"
                      (change)="checksector(secsel)" formControlName="sector">
88
89
90
91
92
                  <option value="0"></option>
                  <option *ngFor="let SectorSelection$  of SectorSelections$ | async; let i=index" [value] = "SectorSelection$.id"> {{SectorSelection$.name}}</option>
                </select>
          </div>
          <div class="col-md-11 offset-md-1">
93
94
95
                <label *ngIf="(showCourseList | async) && enableCourseFilter && (classSelected == 3 || classSelected == 4)">Ειδικότητα</label>
                <select #coursel class="form-control"  *ngIf="(showCourseList | async) && enableCourseFilter && (classSelected == 3 || classSelected == 4)"
                      (change)="checkcourse(coursel)" formControlName="course">
96
97
98
99
                  <option value="0"></option>
                  <option *ngFor="let CourseSelection$  of CourseSelections$ | async; let i=index" [value] = "CourseSelection$.id"> {{CourseSelection$.name}}</option>
                </select>
          </div>
100

101
          <br>
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
          <button type="submit" class="btn btn-alert"  (click)="createReport(regsel)" [hidden]="minedu_userName == ''" >
          <i class="fa fa-file-text"></i>
              Δημιουργία Αναφοράς
          </button>
          <button type="submit" class="btn btn-alert pull-right"  (click)="navigateBack()" [hidden]="minedu_userName == ''" >
              Επιστροφή
          </button>
          <br><br>
        </form>

        <div *ngIf="validCreator == 1 ">
          <input #search class="search" type="text" placeholder="Αναζήτηση..." (keydown.enter)="onSearch(search.value)">
          <div class="smart-table-container" reportScroll>
            <ng2-smart-table [settings]="settings" [source]="source"></ng2-smart-table>
          </div>
        </div>

        <button type="button" class="alert alert-info pull-right" (click)="export2Csv()" [hidden]="validCreator != 1">
        <i class="fa fa-download"></i>
            <br>Εξαγωγή σε csv
        </button>
123
        <button type="button" class="alert alert-info pull-left" (click)="createDiagram()" [hidden]="validCreator != 1 || schSelected == 0 || (reportId != 2 ) ">
124
125
126
127
128
129
130
        <i class="fa fa-bar-chart"></i>
            Διάγραμμα
        </button>

        <div class="d3-chart" *ngIf = "validCreator == 1" #chart>
        </div>
        <br><br><br><br><br>
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145

    </div>

   `
})

@Injectable() export default class ReportAllStat implements OnInit, OnDestroy {

    public formGroup: FormGroup;
    loginInfo$: BehaviorSubject<ILoginInfo>;
    loginInfoSub: Subscription;
    private generalReport$: BehaviorSubject<any>;
    private RegionSelections$: BehaviorSubject<any>;
    private AdminAreaSelections$: BehaviorSubject<any>;
    private SchoolSelections$: BehaviorSubject<any>;
146
147
    private SectorSelections$: BehaviorSubject<any>;
    private CourseSelections$: BehaviorSubject<any>;
148
    private RegionRetrieve$: BehaviorSubject<any>;
149
150
151
152
    private generalReportSub: Subscription;
    private RegionSelectionsSub: Subscription;
    private AdminAreaSelectionsSub: Subscription;
    private SchoolSelectionsSub: Subscription;
153
154
    private SectorSelectionsSub: Subscription;
    private CourseSelectionsSub: Subscription;
155
    private RegionRetrieveSub: Subscription;
156
157
158
159
160
161
162
163
164
    private apiEndPoint = API_ENDPOINT;
    private minedu_userName: string;
    private minedu_userPassword: string;
    private distStatus = "READY";
    private data;
    private validCreator: number;
    private reportId: number;
    private source: LocalDataSource;
    private showAdminList: BehaviorSubject<boolean>;
165
166
    private showSectorList: BehaviorSubject<boolean>;
    private showCourseList: BehaviorSubject<boolean>;
167
    private regionSelected: number;
168
169
    private adminAreaSelected: number;
    private schSelected: number;
170
171
172
    private classSelected: number;
    private sectorSelected: number;
    private courseSelected: number;
173
    private enableRegionFilter: boolean;
174
    private enableCourseFilter: boolean;
175
    private userLoggedIn: string;
176
177
178
179
180
181
182
183

    columnMap: Map<string,TableColumn> = new Map<string,TableColumn>();
    @Input() settings: any;
    private reportSchema = new  reportsSchema();

    //csvObj:csvCreator ;
    private csvObj = new csvCreator();

184
185
186
187
188
189
    private createGraph: boolean;
    //d3 creator
    private chartObj = new chartCreator();
    @ViewChild('chart') public chartContainer: ElementRef;
    private d3data: Array<any>;

190
191
192
193
194
195
196
197
198
199
200
201
202
    //private repid: number;
    private routerSub: any;

    constructor(private fb: FormBuilder,
        private _ngRedux: NgRedux<IAppState>,
        private _hds: HelperDataService,
        private activatedRoute: ActivatedRoute,
        private router: Router) {

          this.formGroup = this.fb.group({
              region: ['', []],
              adminarea: ['', []],
              schoollist: ['', []],
203
204
205
              classid: ['', []],
              sector: ['', []],
              course: ['', []],
206
207
208
209
210
211
212
          });

          this.loginInfo$ = new BehaviorSubject(LOGININFO_INITIAL_STATE);
          this.generalReport$ = new BehaviorSubject([{}]);
          this.RegionSelections$ = new BehaviorSubject([{}]);
          this.AdminAreaSelections$ = new BehaviorSubject([{}]);
          this.SchoolSelections$ = new BehaviorSubject([{}]);
213
214
          this.SectorSelections$ = new BehaviorSubject([{}]);
          this.CourseSelections$ = new BehaviorSubject([{}]);
215
          this.RegionRetrieve$ = new BehaviorSubject([{}]);
216
217
218
          this.minedu_userName = '';
          this.validCreator = -1;
          this.showAdminList = new BehaviorSubject(false);
219
220
          this.showSectorList = new BehaviorSubject(false);
          this.showCourseList = new BehaviorSubject(false);
221
          this.regionSelected = 0;
222
223
          this.adminAreaSelected = 0;
          this.schSelected = 0;
224
225
226
227
228
          this.classSelected = 0;
          this.sectorSelected = 0;
          this.courseSelected = 0;
          this.enableRegionFilter = false;
          this.enableCourseFilter = false;
229
          this.createGraph = false;
230
231
232
233
234
235
236
237
238
239

    }

    ngOnInit() {

      this.loginInfoSub = this._ngRedux.select(state => {
          if (state.loginInfo.size > 0) {
              state.loginInfo.reduce(({}, loginInfoToken) => {
                this.minedu_userName = loginInfoToken.minedu_username;
                this.minedu_userPassword = loginInfoToken.minedu_userpassword;
240
241
242
243

                this.userLoggedIn = loginInfoToken.auth_role;
                if (loginInfoToken.auth_role == PDE_ROLE || loginInfoToken.auth_role == DIDE_ROLE)  {
                    console.log("inside..");
244
                    let regId = -1;
245
246
                    this.minedu_userName = loginInfoToken.auth_token;
                    this.minedu_userPassword = loginInfoToken.auth_token;
247
                    if (loginInfoToken.auth_role == PDE_ROLE || loginInfoToken.auth_role == DIDE_ROLE) {
248
249
250
251
252
253
254
255
256

                      //CALL CONTROLLER THAT RETURNS ID OF PDE

                      this.RegionRetrieveSub = this._hds.getUserRegistryNo(this.minedu_userName, this.minedu_userPassword).subscribe(data => {
                          this.RegionRetrieve$.next(data);
                          this.data = data;
                      },
                          error => {
                              this.RegionRetrieve$.next([{}]);
257
                              console.log("Error Getting getUserRegistryNo");
258
259
                          },
                          () => {
260
261
262
263
264
265
                            regId = this.data['id'];
                            console.log("Success Getting getUserRegistryNo");

                            if (loginInfoToken.auth_role == PDE_ROLE) {
                              this.regionSelected = regId;
                              this.showAdminList.next(true);
266
267
268

                              console.log("Nikos1..");
                              console.log(this.regionSelected);
269
270
271
272
273
274
275
276
277
                              this.checkregion(this. regionSelected);
                            }
                            else if (loginInfoToken.auth_role == DIDE_ROLE) {
                              this.adminAreaSelected = regId;
                              this.showAdminList.next(false);
                              this.checkadminarea(this.adminAreaSelected);
                              //console.log("Test");
                              //console.log(this.adminAreaSelected);
                            }
278
279
280

                          }
                        );
281
282
283
                  }
                }
                return loginInfoToken;
284
285
286
287
288
289
              }, {});
          }
          return state.loginInfo;
      }).subscribe(this.loginInfo$);

      this.routerSub = this.activatedRoute.params.subscribe(params => {
290
291
292
      this.reportId = +params['reportId'];
      //console.log("Hello");
      //console.log(this.reportId);
293
294
295
     });


296
    this.showFilters();
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311

    }

    ngOnDestroy() {

      if (this.loginInfoSub)
        this.loginInfoSub.unsubscribe();
      if (this.generalReportSub)
          this.generalReportSub.unsubscribe();
      if (this.RegionSelectionsSub)
          this.RegionSelectionsSub.unsubscribe();
      if (this.AdminAreaSelectionsSub)
          this.AdminAreaSelectionsSub.unsubscribe();
      if (this.SchoolSelectionsSub)
          this.SchoolSelectionsSub.unsubscribe();
312
313
314
315
      if (this.SectorSelectionsSub)
          this.SectorSelectionsSub.unsubscribe();
      if (this.CourseSelectionsSub)
          this.CourseSelectionsSub.unsubscribe();
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330

          if (this.loginInfo$)
            this.loginInfo$.unsubscribe();
          if (this.generalReport$)
              this.generalReport$.unsubscribe();
          if (this.RegionSelections$)
              this.RegionSelections$.unsubscribe();
          if (this.AdminAreaSelections$)
              this.AdminAreaSelections$.unsubscribe();
          if (this.SchoolSelections$)
              this.SchoolSelections$.unsubscribe();
          if (this.SectorSelections$)
              this.SectorSelections$.unsubscribe();
          if (this.CourseSelections$)
              this.CourseSelections$.unsubscribe();
331
332
      if (this.showAdminList)
          this.showAdminList.unsubscribe();
333
334
335
336
      if (this.showSectorList)
          this.showSectorList.unsubscribe();
      if (this.showCourseList)
          this.showCourseList.unsubscribe();
337
338
      if (this.RegionRetrieveSub)
          this.RegionRetrieveSub.unsubscribe();
339
340
          if (this.RegionRetrieve$)
              this.RegionRetrieve$.unsubscribe();
341
342
343
344
345
346
347

    }


createReport(regionSel) {

  this.validCreator = 0;
348
  this.createGraph = false;
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363

  let route;
  if (this.reportId === 1)  {
    route = "/ministry/general-report/";
    this.settings = this.reportSchema.genReportSchema;
  }
  else if (this.reportId === 2)  {
    route = "/ministry/report-completeness/";
    this.settings = this.reportSchema.reportCompletenessSchema;
  }
  else if (this.reportId === 3)  {
    route = "/ministry/report-all-stat/";
    this.settings = this.reportSchema.reportAllStatSchema;
  }

364
365
366
367
368
369
370
371
 let regSel = 0, admSel = 0, schSel = 0;
 if (this.enableRegionFilter) {
   //if (regionSel.value != 0)
    //regSel = regionSel.value;
   regSel = this.regionSelected;
   admSel = this.adminAreaSelected;
   schSel = this.schSelected;
 }
372

373
374
375
376
377
378
379
 let clSel = 0, secSel = 0, courSel = 0;
 if (this.enableCourseFilter) {
   clSel = this.classSelected;
   secSel = this.sectorSelected;
   courSel = this.courseSelected;
 }

380
381
382
383
384
385
386
387
 if (this.userLoggedIn == PDE_ROLE) {
    regSel = this.regionSelected;
    console.log("Nikos2..");
    console.log(regSel);
  }
 else if (this.userLoggedIn == DIDE_ROLE)
    admSel = this.adminAreaSelected;

388
  this.generalReportSub = this._hds.makeReport(this.minedu_userName, this.minedu_userPassword, route, regSel, admSel, schSel, clSel, secSel, courSel).subscribe(data => {
389
390
      this.generalReport$.next(data);
      this.data = data;
391
392
393
394
395
396
397
398
399
400
401
402

      //console.log("Debugging..");
      //whehever you find column "num" cast it to number value in order to be ordered properly
      for (let i=0;i<this.data.length;i++)  {
        this.data[i].num = Number(data[i].num);
        this.data[i].percentage = Number(data[i].percentage);

        this.data[i].percTotal = Number(data[i].percTotal);
        this.data[i].percA = Number(data[i].percA);
        this.data[i].percB = Number(data[i].percB);
        this.data[i].percC = Number(data[i].percC);
      }
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
  },
    error => {
      this.generalReport$.next([{}]);
      console.log("Error Getting generalReport");
    },
    () => {
      console.log("Success Getting generalReport");
      this.validCreator = 1;
      this.source = new LocalDataSource(this.data);
      this.columnMap = new Map<string,TableColumn>();

      //pass parametes to csv class object
      this.csvObj.columnMap = this.columnMap;
      this.csvObj.source = this.source;
      this.csvObj.settings = this.settings;
      //this.prepareColumnMap();
      this.csvObj.prepareColumnMap();
    }
  )

}

navigateBack()  {
  this.router.navigate(['/ministry/minister-reports']);
}

showFilters() {

    this.RegionSelectionsSub = this._hds.getRegions(this.minedu_userName, this.minedu_userPassword).subscribe(data => {
        this.RegionSelections$.next(data);
    },
        error => {
            this.RegionSelections$.next([{}]);
            console.log("Error Getting RegionSelections");
        },
        () => console.log("Success Getting RegionSelectionsSub"));

}

442
443
444
445
446
447
toggleRegionFilter()  {

  this.enableRegionFilter = !this.enableRegionFilter;

}

448
449
450
451
452
toggleCourseFilter()  {

  this.enableCourseFilter = !this.enableCourseFilter;
}

453
454
checkregion(regionId) {

455
456
    if (typeof regionId.value != "undefined")
      this.regionSelected = regionId.value;
457
458
459
    this.adminAreaSelected = 0;
    this.schSelected = 0;

460
461
    //if (regionId.value != 0)  {

462
    this.AdminAreaSelectionsSub = this._hds.getAdminAreas(this.minedu_userName, this.minedu_userPassword, this.regionSelected).subscribe(data => {
463
464
465
466
467
468
469
470
471
472
473
474
        this.AdminAreaSelections$.next(data);
    },
        error => {
            this.AdminAreaSelections$.next([{}]);
            console.log("Error Getting AdminAreaSelections");
        },
        () => {
          console.log("Success Getting AdminAreaSelectionsSub");
          this.showAdminList.next(true);
        }
      );

475
      this.SchoolSelectionsSub = this._hds.getSchoolsPerRegion(this.minedu_userName, this.minedu_userPassword, this.regionSelected).subscribe(data => {
476
477
478
479
480
481
482
483
484
485
486
487
488
          this.SchoolSelections$.next(data);
      },
          error => {
              this.SchoolSelections$.next([{}]);
              console.log("Error Getting SchoolSelections");
          },
          () => {
            console.log("Success Getting SchoolSelectionsSub");
            this.showAdminList.next(true);
          }

        );

489
490
      //} //end if

491
492
493
494
495
496
497
498
499
  }

  checkadminarea(adminId) {

    this.schSelected = 0;

    console.log("TI EINAI;")
    console.log(adminId);

500
501
502
    if (typeof adminId.value != "undefined")
      this.adminAreaSelected = adminId.value;
    this.SchoolSelectionsSub = this._hds.getSchoolsPerAdminArea(this.minedu_userName, this.minedu_userPassword, this.adminAreaSelected).subscribe(data => {
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
        this.SchoolSelections$.next(data);
    },
        error => {
            this.SchoolSelections$.next([{}]);
            console.log("Error Getting SchoolSelections");
        },
        () => {
          console.log("Success Getting SchoolSelectionsSub");
          this.showAdminList.next(true);
        }

      );
  }

  checkschool(schId) {

      this.schSelected = schId.value;

  }

523
524
525
526
527
528
529
530
531
  checkclass(classId) {

    this.classSelected = classId.value;
    this.sectorSelected = 0;
    this.courseSelected = 0;

    console.log("What?");
    console.log(this.classSelected);

532
    if (this.classSelected == 2 || this.classSelected == 3 || this.classSelected == 4)  {
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
      this.SectorSelectionsSub = this._hds.getSectors(this.minedu_userName, this.minedu_userPassword, this.classSelected).subscribe(data => {
          this.SectorSelections$.next(data);
      },
          error => {
              this.SectorSelections$.next([{}]);
              console.log("Error Getting SectorSelections");
          },
          () => {
            console.log("Success Getting SectorSelections");
            this.showSectorList.next(true);
          }
        );
    } //end if


  }

  checksector(sectorId) {

    this.courseSelected = 0;
    this.sectorSelected = sectorId.value;

555
    this.CourseSelectionsSub = this._hds.getCourses(this.minedu_userName, this.minedu_userPassword, this.sectorSelected).subscribe(data => {
556
557
558
559
560
561
562
563
564
565
566
          this.CourseSelections$.next(data);
      },
          error => {
              this.CourseSelections$.next([{}]);
              console.log("Error Getting CourseSelections");
          },
          () => {
            console.log("Success Getting CourseSelections");
            this.showCourseList.next(true);
          }

567
      );
568
569
570
571
572
573
574
575
576
577


  }

  checkcourse(courseId) {

      this.courseSelected = courseId.value;

  }

578
579


580
  onSearch(query: string = '') {
581

582
583
    this.csvObj.onSearch(query);
  }
584

585
  export2Csv()  {
586

587
    this.csvObj.export2Csv();
588

589
  }
590
591


592
593
594
595
596
597
598
599
createDiagram() {
  if (!this.createGraph)  {
    this.generateGraphData();
    this.chartObj.d3data = this.d3data;
    this.chartObj.chartContainer = this.chartContainer;
    this.chartObj.createChart();
    this.chartObj.updateChart();
    this.createGraph = true;
600
601
602
  }
}

603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
generateGraphData() {

   this.d3data = [];

   if (this.reportId === 2)  {
     let labelsX = [];
     labelsX.push("Σχολείο");
     labelsX.push("Α\' τάξη");
     labelsX.push("Β\' τάξη");
     labelsX.push("Γ\' τάξη");
     labelsX.push("Δ\' τάξη");

     this.d3data.push([
       labelsX[0],
       this.data[0].percTotal,
     ]);
     this.d3data.push([
       labelsX[1],
       this.data[0].percA,
     ]);
     this.d3data.push([
       labelsX[2],
       this.data[0].percB,
     ]);
     this.d3data.push([
       labelsX[3],
       this.data[0].percC,
     ]);
     this.d3data.push([
       labelsX[4],
       this.data[0].percD,
     ]);

   }
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665

   /*
   else if (this.reportId === 3) {

     let labelsX = [];
     labelsX.push("1η Προτίμηση");
     labelsX.push("2η Προτίμηση");
     labelsX.push("3η Προτίμηση");
     labelsX.push("Μη τοποθετημένοι");
     console.log("Length:");
     console.log(this.data.length);
     for (let i = 0; i < this.data.length   ; i++) {
       this.d3data.push([
         //labelsX[i-1],
         this.data[i].section,
         this.data[i].percentage,
       ]);
    // }


   }


  }
  */




666
 }
667
668
669
670
671
672
673






}