From fc65c1fc74d5c983a90ce3ab61ceafbf8e399eea Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Tue, 18 Sep 2012 13:07:03 -0400 Subject: [PATCH] Jqplot profiling chart for query analysis in Status>Monitor --- js/functions.js | 41 ++----------------------------------- js/server_status_monitor.js | 15 ++++---------- 2 files changed, 6 insertions(+), 50 deletions(-) diff --git a/js/functions.js b/js/functions.js index b9fad9e9ee..75e1c8d8c4 100644 --- a/js/functions.js +++ b/js/functions.js @@ -1686,46 +1686,9 @@ function PMA_createChart(passedSettings) return new Highcharts.Chart(settings); } - -/* - * Creates a Profiling Chart. Used in server_status_monitor.js - */ -function PMA_createProfilingChart(data, options) -{ - return PMA_createChart($.extend(true, { - chart: { - renderTo: 'profilingchart', - type: 'pie' - }, - title: { text:'', margin:0 }, - series: [{ - type: 'pie', - name: PMA_messages['strQueryExecutionTime'], - data: data - }], - plotOptions: { - pie: { - allowPointSelect: true, - cursor: 'pointer', - dataLabels: { - enabled: true, - distance: 35, - formatter: function() { - return ''+ this.point.name +'
'+ Highcharts.numberFormat(this.percentage, 2) +' %'; - } - } - } - }, - tooltip: { - formatter: function() { - return ''+ this.point.name +'
'+PMA_prettyProfilingNum(this.y)+'
('+Highcharts.numberFormat(this.percentage, 2) +' %)'; - } - } - },options)); -} - /* * Creates a Profiling Chart with jqplot. Used in sql.js + * and in server_status_monitor.js */ function PMA_createProfilingChartJqplot(target, data) { @@ -1767,7 +1730,7 @@ function PMA_createProfilingChartJqplot(target, data) } /** - * Formats a profiling duration nicely (in us and ms time). Used in PMA_createProfilingChart() and server_status.js + * Formats a profiling duration nicely (in us and ms time). Used in server_status.js * * @param integer Number to be formatted, should be in the range of microsecond to second * @param integer Acuracy, how many numbers right to the comma should be diff --git a/js/server_status_monitor.js b/js/server_status_monitor.js index 38b0cbd236..c466489615 100644 --- a/js/server_status_monitor.js +++ b/js/server_status_monitor.js @@ -2015,17 +2015,10 @@ $(function() { return false; }); - profilingChart = PMA_createProfilingChart(chartData, { - chart: { - renderTo: 'queryProfiling' - }, - plotOptions: { - pie: { - size: '50%' - } - } - }); - + profilingChart = PMA_createProfilingChartJqplot( + 'queryProfiling', + chartData + ); $('div#queryProfiling').resizable(); }