Explorar el Código

- added time stamp on xAxes

Ksawery Kuklinski hace 8 años
padre
commit
6691516d67
Se han modificado 2 ficheros con 171 adiciones y 107 borrados
  1. 161 105
      web/bundle.js
  2. 10 2
      webSource/servergraph.vue

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 161 - 105
web/bundle.js


+ 10 - 2
webSource/servergraph.vue

@@ -51,7 +51,9 @@ var generateTemplate = function(){
     },
     data: function () {
       return {
-        chart: {}
+        chart: {},
+        labels: {},
+        stamp: null
         // datasetTempalte:{
         //   label: "Traffic",
         //   fill: true,
@@ -94,7 +96,11 @@ var generateTemplate = function(){
               }],
               xAxes: [{
                 display: true,
-                type: 'linear',
+                type: 'time',
+                time: {
+                    tooltipFormat: "H:mm:ss",
+                    displayFormat: "H:mm:ss"
+                },
                 position: 'bottom'
               }]
             }
@@ -151,6 +157,7 @@ var generateTemplate = function(){
               self.graphdata.datasets[0].data = [];
               self.graphdata.datasets = [];
               var firstStamp = new Date(obj[0].createdAt);
+              self.stamp = firstStamp;
               var dataset = {
                 label: "Traffic",
                 data: [],
@@ -181,6 +188,7 @@ var generateTemplate = function(){
                 lastStamp = stamp;
                 stamp /= 60;
                 stamp = Math.floor(stamp);
+                stamp = new Date(el.createdAt);
                 dataset.data.push({
                   x: stamp,
                   y: el.players

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio