Skip to content

Commit

Permalink
#209 - final fixes?
Browse files Browse the repository at this point in the history
  • Loading branch information
pliablepixels committed Apr 1, 2016
1 parent 7dce848 commit aae65eb
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
1 change: 1 addition & 0 deletions www/js/TimelineCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ angular.module('zmApp.controllers').controller('zmApp.TimelineCtrl', ['$ionicPla
// $interval.cancel(eventsInterval);
//$interval.cancel(segmentHandle);
ZMDataModel.zmDebug("TimelineCtrl:Close & Destroy Modal");
ZMDataModel.stopNetwork("TimelineCtrl: closeModal");
ZMDataModel.setAwake(false);
if ($scope.modal !== undefined) {
$scope.modal.remove();
Expand Down
11 changes: 10 additions & 1 deletion www/js/TimelineModalCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -192,6 +194,12 @@ angular.module('zmApp.controllers').controller('TimelineModalCtrl', ['$scope', '
legendTemplate : '<ul class="tc-chart-js-legend"><% for (var i=0; i<datasets.length; i++){%><li><span style="background-color:<%=datasets[i].fillColor%>"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>'
};

$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);
Expand All @@ -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)
{
Expand Down
19 changes: 13 additions & 6 deletions www/templates/timeline-modal.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,32 @@
<i class="ion-chevron-down"></i>
</button>



{{errorDetails}}
<p>please zoom in for more precise control</p>
<!--<p>scroll left/right if needed</p>-->
</center>

<div style="padding-left:15px; padding-right:15px;">
<div id="timeline-alarm-vis" ></div>

<!--<canvas id="tc" tc-chartjs-bar chart-options="options" chart-data="data" auto-legend ng-if="dataReady" chart="tcchart" ng-click="chartClick($event)"></canvas>-->


<!-- <ion-scroll direction="x" >
<div style="width:{{graphWidth}}px;">-->
<canvas id="tcchart"></canvas>
<!--</div>
</ion-scroll>-->




<canvas id="tcchart"></canvas>
</div>


<ion-spinner icon="spiral" style="position:absolute; top:50%;left:50%" ng-if="!dataReady"></ion-spinner>

<div style="height:190px;">
<ion-scroll direction="x" class="wide-as-needed">
<!-- <ion-scroll direction="x" class="wide-as-needed">-->
<span ng-repeat="alarm in alarm_images">


Expand All @@ -50,7 +57,7 @@

</span>

</ion-scroll>
<!--</ion-scroll>-->
</div>
</div>
</ion-content>
Expand Down

0 comments on commit aae65eb

Please sign in to comment.