diff --git a/js/functions.js b/js/functions.js index 60ef801a65..b942bcd6f9 100644 --- a/js/functions.js +++ b/js/functions.js @@ -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 * diff --git a/js/sql.js b/js/sql.js index 1323ef6b8a..57c28e5926 100644 --- a/js/sql.js +++ b/js/sql.js @@ -610,7 +610,7 @@ function makeProfilingChart() // Prevent the user from seeing the JSON code $('div#profilingchart').html('').show(); - PMA_createProfilingChart(data); + PMA_createProfilingChartJqplot(data); } diff --git a/sql.php b/sql.php index f60c66a45e..a6b9fe29e7 100644 --- a/sql.php +++ b/sql.php @@ -27,14 +27,12 @@ $GLOBALS['js_include'][] = 'codemirror/mode/mysql/mysql.js'; 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 @@ $(document).ready(makeProfilingChart); echo '' . "\n"; echo ''; - //require_once './libraries/chart.lib.php'; echo '
'; echo '' . "\n";