Permalink
Browse files

jqPlot for profiling chart

  • Loading branch information...
1 parent b8603f1 commit a44ee5909345fe24adcbd498ecc9255e36f66d58 @lem9 lem9 committed May 11, 2012
Showing with 25 additions and 8 deletions.
  1. +22 −1 js/functions.js
  2. +1 −1 js/sql.js
  3. +2 −6 sql.php
View
@@ -1686,7 +1686,7 @@ function PMA_createChart(passedSettings)
/*
- * Creates a Profiling Chart. Used in sql.php and server_status.js
+ * Creates a Profiling Chart. Used in server_status.js
*/
function PMA_createProfilingChart(data, options)
{
@@ -1722,6 +1722,27 @@ function PMA_createProfilingChart(data, options)
},options));
}
+/*
+ * Creates a Profiling Chart with jqplot. Used in sql.js
+ */
+function PMA_createProfilingChartJqplot(data, options)
+{
+ return $.jqplot('profilingchart', [data],
+ {
+ seriesDefaults: {
+ renderer: $.jqplot.PieRenderer,
+ rendererOptions: {
+ showDataLabels: true
+ }
+ },
+ legend: {
+ show: true,
+ location: 'e'
+ }
+ }
+ );
+}
+
/**
* Formats a profiling duration nicely (in us and ms time). Used in PMA_createProfilingChart() and server_status.js
*
View
@@ -610,7 +610,7 @@ function makeProfilingChart()
// Prevent the user from seeing the JSON code
$('div#profilingchart').html('').show();
- PMA_createProfilingChart(data);
+ PMA_createProfilingChartJqplot(data);
}
View
@@ -27,14 +27,12 @@
if (isset($_SESSION['profiling'])) {
- $GLOBALS['js_include'][] = 'highcharts/highcharts.js';
- /* Files required for chart exporting */
- $GLOBALS['js_include'][] = 'highcharts/exporting.js';
/* < IE 9 doesn't support canvas natively */
if (PMA_USR_BROWSER_AGENT == 'IE' && PMA_USR_BROWSER_VER < 9) {
$GLOBALS['js_include'][] = 'canvg/flashcanvas.js';
}
- $GLOBALS['js_include'][] = 'canvg/canvg.js';
+ $GLOBALS['js_include'][] = 'jqplot/jquery.jqplot.js';
+ $GLOBALS['js_include'][] = 'jqplot/plugins/jqplot.pieRenderer.js';
}
/**
@@ -916,9 +914,7 @@
echo '</table>' . "\n";
echo '</div>';
- //require_once './libraries/chart.lib.php';
echo '<div id="profilingchart" style="display:none;">';
- //PMA_chart_profiling($profiling_results);
echo json_encode($chart_json);
echo '</div>';
echo '</fieldset>' . "\n";

0 comments on commit a44ee59

Please sign in to comment.