From 23c84592dac5e23da617c30c01ec7a86f212dce0 Mon Sep 17 00:00:00 2001 From: Atul Pratap Singh Date: Sat, 12 Jan 2013 00:45:35 +0530 Subject: [PATCH] Free data values when they are out of sight --- js/server_status_monitor.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/js/server_status_monitor.js b/js/server_status_monitor.js index 0e4ae6fdd1..3c4fbe523c 100644 --- a/js/server_status_monitor.js +++ b/js/server_status_monitor.js @@ -1507,13 +1507,14 @@ AJAX.registerOnload('server_status_monitor.js', function() { elem.maxYLabel = value; } // free old data point values and update maxYLabel - if (elem.chart.series[j].data.length > runtime.gridMaxPoints) { + if (elem.chart.series[j].data.length > runtime.gridMaxPoints + && elem.chart.series[j].data[0][0] < runtime.xmin) { // check if the next freeable point is highest if (elem.maxYLabel <= elem.chart.series[j].data[0][1]) { - elem.chart.series[j].data.shift(); + elem.chart.series[j].data.splice(0, elem.chart.series[j].data.length - runtime.gridMaxPoints); elem.maxYLabel = getMaxYLabel(elem.chart.series[j].data); } else { - elem.chart.series[j].data.shift(); + elem.chart.series[j].data.splice(0, elem.chart.series[j].data.length - runtime.gridMaxPoints); } } if (elem.title === PMA_messages['strSystemMemory']