Skip to content

Commit

Permalink
jqPlot for profiling chart
Browse files Browse the repository at this point in the history
  • Loading branch information
lem9 committed May 11, 2012
1 parent b8603f1 commit a44ee59
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 8 deletions.
23 changes: 22 additions & 1 deletion js/functions.js
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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
*
Expand Down
2 changes: 1 addition & 1 deletion js/sql.js
Expand Up @@ -610,7 +610,7 @@ function makeProfilingChart()
// Prevent the user from seeing the JSON code
$('div#profilingchart').html('').show();

PMA_createProfilingChart(data);
PMA_createProfilingChartJqplot(data);
}


Expand Down
8 changes: 2 additions & 6 deletions sql.php
Expand Up @@ -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';
}

/**
Expand Down Expand Up @@ -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";
Expand Down

0 comments on commit a44ee59

Please sign in to comment.