Explorar o código

Graph y scale

A-Konig hai 1 semana
pai
achega
af01693920

+ 3 - 5
src/app/shared/graph-loading/graphloader.ts

@@ -44,9 +44,9 @@ export class GraphLoader {
   static getGraphWithInterval(sensors, data, interval, legendInfo, element, isAnalytics) {
     // gets uses sensors array to get graph type
     // then gets configuration and specification from corresponding class
-    let graph = this.getGraphType(sensors,data, interval, legendInfo, isAnalytics);
-    let config = graph.getConfig();
-    let spec = graph.getSpec();
+    const graph = this.getGraphType(sensors,data, interval, legendInfo, isAnalytics);
+    const config = graph.getConfig();
+    const spec = graph.getSpec();
 
    // then displays the graph
     return this.showGraph(spec, config, element);
@@ -92,8 +92,6 @@ export class GraphLoader {
     const vegaTooltip = require('vega-tooltip');
     const handler = new vegaTooltip.Handler();
 
-    console.log(config.height);
-
     config.width = this.width;
     config.height = this.height;
 

+ 3 - 1
src/app/unit/components/unit.component.html

@@ -72,7 +72,9 @@
         <div class="d-inline-flex">
           <div *ngFor="let sensor of sensors">
             <div *ngIf="sensor.sensorId.toString().slice(0, 5) === group">
-              <p-checkbox class="align-text-top" [id]="sensor.sensorId" name="{{group}}" [value]="sensor.sensorId.toString()" [(ngModel)]="selectedSensors" [inputId]="sensor.sensorId.toString()" (onChange)="addSensorToGraph(sensor.sensorId.toString(), $event)"></p-checkbox>
+              <p-checkbox class="align-text-top" [id]="sensor.sensorId" name="{{group}}" [value]="sensor.sensorId.toString()"
+                          [(ngModel)]="selectedSensors" [inputId]="sensor.sensorId.toString()"
+                          (onChange)="addSensorToGraph(sensor.sensorId.toString(), $event)"></p-checkbox>
               <label >{{sensor.sensorName}}</label>
             </div>
           </div>

+ 4 - 2
src/vega/base/default.json

@@ -57,7 +57,7 @@
         },
         {
           "type": "formula",
-          "expr": "datum[\"maxValueTemp\"] * 1.05",
+          "expr": "datum[\"maxValueTemp\"] * 1.0",
           "as": "valueMax"
         }
       ]
@@ -195,7 +195,9 @@
           "type": "linear",
           "range": [70, 0],
           "domain": {"data": "table", "field": "value"},
-          "nice": true, "zero": true
+          "nice": true,
+          "zero": false,
+          "padding": 0
         }
       ],
       "axes": [

+ 2 - 1
src/vega/body/barchart.json

@@ -109,7 +109,8 @@
             ]
           },
           "nice": true,
-          "zero": true
+          "zero": false,
+          "padding": 0
         }
       ],
       "axes": [

+ 3 - 1
src/vega/body/linechart.json

@@ -116,7 +116,9 @@
               {"data":  "table", "field": "value"}
             ]
           },
-          "nice": true, "zero": true
+          "nice": true,
+          "zero": false,
+          "padding": 0
         }
       ],
       "axes": [

+ 2 - 1
src/vega/body/multilinechart.json

@@ -226,7 +226,8 @@
             ]
           },
           "nice": true,
-          "zero": true
+          "zero": false,
+          "padding": 0
         },
         {
           "name": "color",