From d3f511253b50bfcb1c578ddc9280cecf1e037cf4 Mon Sep 17 00:00:00 2001 From: pliablepixels Date: Fri, 1 Apr 2016 10:41:33 -0400 Subject: #209 - final fixes? Former-commit-id: 0b7a117a396b6cf915936b0b484a1b453af0250f --- www/js/TimelineModalCtrl.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'www/js/TimelineModalCtrl.js') diff --git a/www/js/TimelineModalCtrl.js b/www/js/TimelineModalCtrl.js index 9895bc4c..535e8f14 100644 --- a/www/js/TimelineModalCtrl.js +++ b/www/js/TimelineModalCtrl.js @@ -94,6 +94,8 @@ angular.module('zmApp.controllers').controller('TimelineModalCtrl', ['$scope', ' $scope.$on('modal.shown', function () { + $scope.graphWidth=$rootScope.devWidth-30; + ZMDataModel.zmLog ("Setting init graph width to " + $scope.graphWidth); $scope.dataReady = false; ZMDataModel.getKeyConfigParams(0) @@ -192,6 +194,12 @@ angular.module('zmApp.controllers').controller('TimelineModalCtrl', ['$scope', ' legendTemplate : '' }; + $scope.graphWidth = event.event.Frame.length * 10; + if ($scope.graphWidth < $rootScope.devWidth) + $scope.graphWidth = $rootScope.devWidth; + + ZMDataModel.zmLog ("Changing graph width to " + $scope.graphWidth); + for (var i=0; i< event.event.Frame.length; i++) { data.labels.push(event.event.Frame[i].TimeStamp); @@ -214,7 +222,8 @@ angular.module('zmApp.controllers').controller('TimelineModalCtrl', ['$scope', ' cv = document.getElementById("tcchart"); ctx = cv.getContext("2d"); - tcGraph = new Chart(ctx,{type:'bar', data: data, options:options}); + $timeout(function() { + tcGraph = new Chart(ctx,{type:'bar', data: data, options:options});}); cv.onclick = function(e) { -- cgit v1.2.3