diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2016-03-06 21:21:12 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2016-03-06 21:30:39 +0100 |
commit | 45267e41368fbb9fb318fb455981110e83c97953 (patch) | |
tree | fc4b819604081076ec97962a5f2dad3b99f51399 /web/static/app/diller/web.js | |
parent | 7ca173de3de046501d79164da0c8c8871a03089b (diff) | |
download | diller-server-45267e41368fbb9fb318fb455981110e83c97953.tar.gz diller-server-45267e41368fbb9fb318fb455981110e83c97953.tar.bz2 diller-server-45267e41368fbb9fb318fb455981110e83c97953.tar.xz diller-server-45267e41368fbb9fb318fb455981110e83c97953.zip |
web:
o Adding level to Interval that specifies what kind of aggregate level the server should use.
Diffstat (limited to 'web/static/app/diller/web.js')
-rw-r--r-- | web/static/app/diller/web.js | 55 |
1 files changed, 1 insertions, 54 deletions
diff --git a/web/static/app/diller/web.js b/web/static/app/diller/web.js index 4b173ad..911cae5 100644 --- a/web/static/app/diller/web.js +++ b/web/static/app/diller/web.js @@ -48,6 +48,7 @@ ctrl.device = device.data.device; ctrl.property = _.find(ctrl.device.properties, {id: $route.current.params.propertyId}); } + updateData(device); ctrl.values = values.data.values; @@ -92,60 +93,6 @@ }; ctrl.interval = Diller.Interval.hours(5); - - // ctrl.values24h = values24h.data.values; - - function chartist() { - var avgs = _.pluck(ctrl.values24h, 'avg'); - var timestamps = _.map(ctrl.values24h, function(row) { - var m = moment(row.timestamp, isoFormat); - return m.format('HH:mm'); - }); - - var data = { - labels: timestamps, - series: [ - avgs - ] - }; - - var options = { - axisX: { - showLabel: false, - showGrid: false - } - }; - -// options.lineSmooth = Chartist.Interpolation.cardinal({ -// fillHoles: true, -// }) - - options.axisX = { - showLabel: true, - showGrid: true, - labelInterpolationFnc: function(value, index) { - return index % 4 === 0 ? value : null; - } - }; - - var chartData = { - series: [[]], - labels: [] - }; - - // var chart = new Chartist.Line('#values-chart', chartData, options); - // console.log('chart', chart); -/* - $timeout(function() { - chartData = data; - // console.log(data); - var chart = new Chartist.Line('#values-chart', chartData, options); - console.log('chart', chart); - }); -*/ - } - - // chartist(); } function TimestampFilter() { |