diff --git a/src/views/app.js b/src/views/app.js index 1661421a3..e67d5ce1f 100644 --- a/src/views/app.js +++ b/src/views/app.js @@ -606,7 +606,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location' var timePeriod = $scope.graphs.period * 60; var timeBucketSize = $scope.graphs.period > 24 ? (6*60) : 5; - function fillGraph(canvasId, data, label, chartPropertyName) { + function fillGraph(canvasId, data, label, chartPropertyName, max) { // translate the data from bytes to MB var datapoints = data.datapoints.map(function (d) { return parseInt((d[0] / 1024 / 1024).toFixed(2)); }); var labels = datapoints.map(function (d, index) { @@ -639,6 +639,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location' yAxes: [{ ticks: { min: 0, + max: max, beginAtZero: true } }] @@ -657,7 +658,9 @@ angular.module('Application').controller('AppController', ['$scope', '$location' Client.graphs([ memoryQuery, diskQuery ], '-' + timePeriod + 'min', {}, function (error, result) { if (error) return console.error(error); - fillGraph('#graphsMemoryChart', result[0], 'Memory', 'memoryChart'); + var currentMemoryLimit = $scope.app.memoryLimit || $scope.app.manifest.memoryLimit || (256 * 1024 * 1024); + + fillGraph('#graphsMemoryChart', result[0], 'Memory', 'memoryChart', currentMemoryLimit / 1024 / 1024); fillGraph('#graphsDiskChart', result[1], 'Disk', 'diskChart'); }); }