new graph

This commit is contained in:
Martin Donnelly 2016-08-15 16:29:24 +01:00
parent 3afe833595
commit 40871afd81

View File

@ -234,6 +234,7 @@
template: _.template($('#AMChart-template').html()),
initialize: function() {
this.modes = ['', 'lux', 'temp', 'co2', 'humid', 'noise'];
this.titles = ['','Light Levels','Temperature','Co2 Levels','Humidity','Sound'];
this.mode = 0;
// Config AMChart
@ -289,7 +290,7 @@
var mode = parseInt(this.mode);
console.log('mode:', mode, this.mode);
debugger;
_(this.collection.models).each(function(i) {
var dt = i.get('dt');
var obj;
@ -356,6 +357,8 @@
valueAxis.axisAlpha = 0;
valueAxis.showFirstLabel = false;
valueAxis.showLastLabel = false;
valueAxis.title = this.titles[this.mode];
valueAxis.position = 'left';
self.chart.addValueAxis(valueAxis);
if (mode === 6) {
@ -364,6 +367,7 @@
co2Axis.axisAlpha = 0;
co2Axis.showFirstLabel = false;
co2Axis.showLastLabel = false;
co2Axis.title = "Co2 Levels";
co2Axis.position = 'right';
self.chart.addValueAxis(co2Axis);