From 6696ec8e3bc2de78224ab95c512569b7c151ff11 Mon Sep 17 00:00:00 2001
From: Vitalii Lysak <v.lysak@dunice.net>
Date: Wed, 27 Jul 2022 14:22:53 +0300
Subject: add accuracy for chart

---
 src/components/_sila/Global/Chart.vue | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

(limited to 'src/components/_sila/Global/Chart.vue')

diff --git a/src/components/_sila/Global/Chart.vue b/src/components/_sila/Global/Chart.vue
index 3622e76f..8538bbd3 100644
--- a/src/components/_sila/Global/Chart.vue
+++ b/src/components/_sila/Global/Chart.vue
@@ -85,13 +85,8 @@ export default {
 
       let transform = filteredData.map((metric) => {
         let date = new Date(metric.Timestamp);
-        let time;
-        if (this.timeScale === 'hour') {
-          time =
-            date.getHours() + ':' + String(date.getMinutes()).padStart(2, '0');
-        } else {
-          time = date.getHours() + ':00';
-        }
+        let time =
+          date.getHours() + ':' + String(date.getMinutes()).padStart(2, '0');
         return {
           ...metric,
           Timestamp: time,
@@ -102,7 +97,7 @@ export default {
       return transform;
     },
     step() {
-      return this.timeScale === 'hour' ? 10 : 1;
+      return this.timeScale === 'hour' ? 10 : 60;
     },
     metricData() {
       let group = this.readyData.reduce(function (rv, x) {
-- 
cgit v1.2.3

