You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ri...@apache.org on 2022/08/15 12:48:28 UTC

[incubator-streampipes] 01/02: [hotfix] Improve x axis representation of line chart

This is an automated email from the ASF dual-hosted git repository.

riemer pushed a commit to branch STREAMPIPES-577
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git

commit 2c1c82f5dec57cca780bc92b62953d128cda763e
Author: Dominik Riemer <do...@gmail.com>
AuthorDate: Mon Aug 15 13:09:19 2022 +0200

    [hotfix] Improve x axis representation of line chart
---
 .../dashboard/components/widgets/base/base-ngx-line-charts-widget.ts   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ui/src/app/dashboard/components/widgets/base/base-ngx-line-charts-widget.ts b/ui/src/app/dashboard/components/widgets/base/base-ngx-line-charts-widget.ts
index 94fef221b..55d608560 100644
--- a/ui/src/app/dashboard/components/widgets/base/base-ngx-line-charts-widget.ts
+++ b/ui/src/app/dashboard/components/widgets/base/base-ngx-line-charts-widget.ts
@@ -63,8 +63,9 @@ export abstract class BaseNgxLineChartsStreamPipesWidget extends BaseNgxChartsSt
     }
 
     timestampTickFormatting(timestamp: any): string {
+        const padL = (nr, len = 2, chr = `0`) => `${nr}`.padStart(2, chr);
         const date = new Date(timestamp);
-        return date.getHours() + ':' + date.getMinutes().toString().substr(-2) + ':' + date.getSeconds().toString().substr(-2);
+        return date.getHours() + ':' + `${padL(date.getMinutes())}` + ':' + `${padL(date.getSeconds())}`;
     }
 
     protected getQueryLimit(extractor: StaticPropertyExtractor): number {