diff --git a/platform/features/plot-reborn/bundle.json b/platform/features/plot-reborn/bundle.json index 96b2a2fe9d..9c3176c0a4 100644 --- a/platform/features/plot-reborn/bundle.json +++ b/platform/features/plot-reborn/bundle.json @@ -35,7 +35,7 @@ { "key": "mctChart", "implementation": "directives/MCTChart.js", - "depends": [ "$interval", "$log" ] + "depends": [ "$interval", "$log", "agentService" ] }, { "key": "mctPlot", @@ -58,7 +58,7 @@ { "key": "PlotController", "implementation": "controllers/PlotController.js", - "depends": [ "$scope", "colorService"] + "depends": [ "$scope", "colorService", "agentService"] }, { "key": "StackedPlotController", diff --git a/platform/features/plot-reborn/src/controllers/PlotController.js b/platform/features/plot-reborn/src/controllers/PlotController.js index 7d745580ab..c1a347ed77 100644 --- a/platform/features/plot-reborn/src/controllers/PlotController.js +++ b/platform/features/plot-reborn/src/controllers/PlotController.js @@ -9,7 +9,7 @@ define( // domainObject metadata. var DOMAIN_INTERVAL = 2 * 60 * 1000; // Two minutes. - function PlotController($scope, colorService) { + function PlotController($scope, colorService, agentService) { var plotHistory = [], isLive = true, maxDomain = +new Date(), diff --git a/platform/features/plot-reborn/src/directives/MCTChart.js b/platform/features/plot-reborn/src/directives/MCTChart.js index 37b39ac11f..b55175a1de 100644 --- a/platform/features/plot-reborn/src/directives/MCTChart.js +++ b/platform/features/plot-reborn/src/directives/MCTChart.js @@ -35,7 +35,7 @@ define( * * @constructor */ - function MCTChart($interval) { + function MCTChart($interval, $log, agentService) { function linkChart($scope, $element) { var canvas = $element.find("canvas")[0], @@ -199,8 +199,13 @@ define( } } - // Check for resize, on a timer - activeInterval = $interval(drawIfResized, 1000); + // Check for resize, on a timer, the timer is 15 + // on mobile (to allow quick refresh of drawing). + if(agentService.isMobile(navigator.userAgent)) { + activeInterval = $interval(drawIfResized, 15, false); + } else { + activeInterval = $interval(drawIfResized, 1000, false); + } $scope.$on('series:data:add', onSeriesDataAdd); redraw();