From 56108fece28c499ceb735a048fdf74613ced8258 Mon Sep 17 00:00:00 2001 From: Atul Pratap Singh Date: Fri, 24 May 2013 01:30:02 +0530 Subject: [PATCH 1/4] Merge commit 0e23451efa4f0ac700c2773c996fec969b985401 --- js/server_status_monitor.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/server_status_monitor.js b/js/server_status_monitor.js index 286cb7539a..91e944fe6c 100644 --- a/js/server_status_monitor.js +++ b/js/server_status_monitor.js @@ -1203,7 +1203,9 @@ AJAX.registerOnload('server_status_monitor.js', function() { $('#chartGrid').append(''); } - $('#chartGrid tr:last').append('
'); + $('#chartGrid tr:last').append('
'); } // Set series' data as [0,0], smooth lines won't plot with data array having null values. From 1647fa300959e54ba5e9d3ea384507e8f4d80794 Mon Sep 17 00:00:00 2001 From: Atul Pratap Singh Date: Fri, 24 May 2013 01:35:37 +0530 Subject: [PATCH 2/4] Show log analyze dialog if timespan width more than zero --- js/server_status_monitor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/server_status_monitor.js b/js/server_status_monitor.js index 91e944fe6c..8cee9121af 100644 --- a/js/server_status_monitor.js +++ b/js/server_status_monitor.js @@ -1275,7 +1275,7 @@ AJAX.registerOnload('server_status_monitor.js', function() { selectionTimeDiff.push(datapos.xaxis); - if (selectionTimeDiff[1] < selectionTimeDiff[0]) { + if (selectionTimeDiff[1] <= selectionTimeDiff[0]) { selectionTimeDiff = []; return; } From faa3d2c24cfc414090c4f4c3901c4723e7b2789e Mon Sep 17 00:00:00 2001 From: Atul Pratap Singh Date: Fri, 24 May 2013 01:41:48 +0530 Subject: [PATCH 3/4] Merge commit e2163b39e9a5d17cab5c1ad4372ae491f08ae1fa --- js/server_status_monitor.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/server_status_monitor.js b/js/server_status_monitor.js index 8cee9121af..25b8ecd16b 100644 --- a/js/server_status_monitor.js +++ b/js/server_status_monitor.js @@ -1268,8 +1268,8 @@ AJAX.registerOnload('server_status_monitor.js', function() { .fadeIn(); }); - $('#gridchart' + runtime.chartAI).bind('jqplotMouseUp', function(ev, gridpos, datapos, neighbor, plot) { - if (! drawTimeSpan) { + $('#gridchart' + runtime.chartAI).bind('jqplotMouseUp', function (ev, gridpos, datapos, neighbor, plot) { + if (! drawTimeSpan || editMode) { return; } @@ -1287,8 +1287,8 @@ AJAX.registerOnload('server_status_monitor.js', function() { drawTimeSpan = false; }); - $('#gridchart' + runtime.chartAI).bind('jqplotMouseMove', function(ev, gridpos, datapos, neighbor, plot) { - if (! drawTimeSpan) { + $('#gridchart' + runtime.chartAI).bind('jqplotMouseMove', function (ev, gridpos, datapos, neighbor, plot) { + if (! drawTimeSpan || editMode) { return; } if (selectionStartX != undefined) { From ce3922ab4b2220c08c486d9032129afcc9c760d5 Mon Sep 17 00:00:00 2001 From: Atul Pratap Singh Date: Wed, 17 Apr 2013 15:36:42 +0530 Subject: [PATCH 4/4] Improved tooltip for monitor charts --- js/server_status_monitor.js | 45 +++++++++++++++++++++++++++++++++---- 1 file changed, 41 insertions(+), 4 deletions(-) diff --git a/js/server_status_monitor.js b/js/server_status_monitor.js index 25b8ecd16b..23296722e3 100644 --- a/js/server_status_monitor.js +++ b/js/server_status_monitor.js @@ -1169,10 +1169,7 @@ AJAX.registerOnload('server_status_monitor.js', function() { lineWidth: 2 }, highlighter: { - show: true, - showTooltip: true, - tooltipAxes: 'y', - useAxesFormatters: true + show: true } }; @@ -1214,6 +1211,46 @@ AJAX.registerOnload('server_status_monitor.js', function() { for (i in chartObj.series) { series.push([[0,0]]); } + + // set Tooltip for each series + for(i in settings.series) { + settings.series[i].highlighter = { + show: true, + tooltipContentEditor: function (str, seriesIndex, pointIndex, plot) { + var tooltipHtml = '
'; + // x value i.e. time + var timeValue = str.split(",")[0]; + tooltipHtml += 'Time: ' + timeValue; + tooltipHtml += ''; + // Add y values to the tooltip per series + for (j in plot.series) { + // get y value if present + if (plot.series[j].data.length > pointIndex) { + var seriesValue = plot.series[j].data[pointIndex][1]; + } + else { + return; + } + var seriesLabel = plot.series[j].label; + var seriesColor = plot.series[j].color; + // format y value + if (plot.series[0]._yaxis.tickOptions.formatter) { + // using formatter function + seriesValue = plot.series[0]._yaxis.tickOptions.formatter('%s', seriesValue); + } else if (plot.series[0]._yaxis.tickOptions.formatString) { + // using format string + seriesValue = $.sprintf(plot.series[0]._yaxis.tickOptions.formatString, seriesValue); + } + tooltipHtml += '
' + + seriesLabel + ': ' + seriesValue + ''; + } + tooltipHtml += '
'; + return tooltipHtml; + } + }; + } + chartObj.chart = $.jqplot('gridchart' + runtime.chartAI, series, settings); // remove [0,0] after plotting for (i in chartObj.chart.series) {