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/18 20:33:07 UTC
[incubator-streampipes] 01/15: [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 rel/0.70.0
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git
commit 5dd99908f7996d9e405652db996d35bdd13a3052
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 {