X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=src%2Fapp%2Fdashboard%2FDashboardComponent.ts;h=b3e48e4218af7d4029e84f3a01c8f64d04c2673b;hb=refs%2Ftags%2Fv13.0.0rc1;hp=d6dc80128dfd166325aa870c12eec85c67a0468c;hpb=0e9c0a43e54ad1d5a535d43a266c83be534f57dc;p=osm%2FNG-UI.git diff --git a/src/app/dashboard/DashboardComponent.ts b/src/app/dashboard/DashboardComponent.ts index d6dc801..b3e48e4 100644 --- a/src/app/dashboard/DashboardComponent.ts +++ b/src/app/dashboard/DashboardComponent.ts @@ -57,7 +57,7 @@ export class DashboardComponent implements OnInit { /** Invoke service injectors @public */ public injector: Injector; - /** handle translate @public */ + /** Handle translate @public */ public translateService: TranslateService; /** Observable holds logined value @public */ @@ -177,6 +177,9 @@ export class DashboardComponent implements OnInit { /** Contians hour converter @private */ private hourConverter: number = 3600; + /** Converter used to round off time to one decimal point @private */ + private converter: number = 10; + /** Notifier service to popup notification @private */ private notifierService: NotifierService; @@ -310,7 +313,7 @@ export class DashboardComponent implements OnInit { const now: Date = new Date(); const currentTime: number = Number((now.getTime().toString().slice(0, this.sliceLimit))); this.createdTimes.forEach((createdTime: string): void => { - this.noOfHours.push((Math.round((currentTime - Number(createdTime)) / this.hourConverter))); + this.noOfHours.push(Math.floor(((currentTime - Number(createdTime)) / this.hourConverter) * (this.converter)) / this.converter); }); this.drawNsChart(); } @@ -330,6 +333,11 @@ export class DashboardComponent implements OnInit { }] }, options: { + layout: { + padding: { + top: 20 + } + }, hover: { onHover(evt: Event, item: {}): void { const el: HTMLElement = document.getElementById('canvas'); @@ -348,7 +356,7 @@ export class DashboardComponent implements OnInit { display: true, scaleLabel: { display: true, - labelString: this.translateService.instant('INSTANCES') + labelString: this.translateService.instant('NSINSTANCES') } }], yAxes: [{ @@ -368,7 +376,7 @@ export class DashboardComponent implements OnInit { /** Get VNFD instance details @public */ public getVnfInstanceCount(): void { - this.vnfInstanceCountSub = this.restService.getResource(environment.NSDINSTANCES_URL) + this.vnfInstanceCountSub = this.restService.getResource(environment.VNFINSTANCES_URL) .subscribe((vnfInstanceData: VNFInstanceDetails[]): void => { this.vnfInstanceCount = vnfInstanceData.length; }, (error: ERRORDATA): void => {