|
@@ -16,15 +16,16 @@ app.controller('temperature', function($scope, temperatureService, $interval) {
|
|
|
},
|
|
|
height: 400,
|
|
|
backgroundColor: 'transparent',
|
|
|
- legend: {position: 'none'},
|
|
|
- curveType: 'function',
|
|
|
+ legend:{
|
|
|
+ position: 'top',
|
|
|
+ alignment: 'start'
|
|
|
+ },
|
|
|
+ series: {
|
|
|
+ 0:{axis:'Inside'},
|
|
|
+ 1:{axis:'Outside'}
|
|
|
+ },
|
|
|
vAxis: {
|
|
|
- title: "Temperature",
|
|
|
- viewWindowMode: 'explicit',
|
|
|
- viewWindow: {
|
|
|
- max: 25,
|
|
|
- min: 10
|
|
|
- }
|
|
|
+ title: "Temperature"
|
|
|
}
|
|
|
};
|
|
|
|
|
@@ -36,9 +37,10 @@ app.controller('temperature', function($scope, temperatureService, $interval) {
|
|
|
function drawChart(data) {
|
|
|
var chartData = new google.visualization.DataTable();
|
|
|
chartData.addColumn('date', 'Timestamp');
|
|
|
- chartData.addColumn('number', 'Reading');
|
|
|
+ chartData.addColumn('number', 'Inside');
|
|
|
+ chartData.addColumn('number', 'Outside');
|
|
|
angular.forEach(data, function(datum) {
|
|
|
- chartData.addRow([new Date(datum.Timestamp * 1000), parseFloat(datum.Reading)]);
|
|
|
+ chartData.addRow([new Date(datum.Timestamp * 1000), parseFloat(datum.Inside), parseFloat(datum.Outside)]);
|
|
|
});
|
|
|
chart.draw(chartData, chartOptions);
|
|
|
}
|
|
@@ -58,7 +60,7 @@ app.controller('temperature', function($scope, temperatureService, $interval) {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- $interval(updateCurrentTemperature, 2000);
|
|
|
+ $interval(updateCurrentTemperature, 5000);
|
|
|
|
|
|
$scope.getGraphPercentage = function() {
|
|
|
var graphTarget = ($scope.temperatureData.currentTarget * 1.2) - graphAdjustment;
|