-Tabs +Spaces

This commit is contained in:
Tyron Madlener 2011-06-08 01:53:21 +02:00
parent 902fc1d95d
commit fcb3273c64
2 changed files with 63 additions and 62 deletions

View File

@ -1161,42 +1161,43 @@ $(document).ready(function() {
* Profiling Chart
*/
$(document).ready(function() {
if($('#profilingchart').length==0) return;
var cdata = new Array();
$.each(jQuery.parseJSON($('#profilingchart').html()),function(key,value) {
cdata.push([key,parseFloat(value)]);
});
if($('#profilingchart').length==0) return;
var cdata = new Array();
var i=1;
$.each(jQuery.parseJSON($('#profilingchart').html()),function(key,value) {
cdata.push([key,parseFloat(value)]);
i++;
});
PMA_createChart({
chart: {
renderTo: 'profilingchart',
backgroundColor: $('#sqlqueryresults fieldset').css('background-color')
},
title: { text:'', margin:0 },
series: [{
type:'pie',
name: 'Query execution time',
data: cdata
}],
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: true,
distance: 35,
formatter: function() {
return '<b>'+ this.point.name +'</b><br> '+ Highcharts.numberFormat(this.percentage, 2) +' %';
}
}
}
},
tooltip: {
formatter: function() { return '<b>'+ this.point.name +'</b><br/>'+this.y+'s<br/>('+Highcharts.numberFormat(this.percentage, 2) +' %)'; }
}
});
PMA_createChart({
chart: {
renderTo: 'profilingchart',
backgroundColor: $('#sqlqueryresults fieldset').css('background-color')
},
title: { text:'', margin:0 },
series: [{
type:'pie',
name: 'Query execution time',
data: cdata
}],
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: true,
distance: 35,
formatter: function() {
return '<b>'+ this.point.name +'</b><br/>'+ Highcharts.numberFormat(this.percentage, 2) +' %';
}
}
}
},
tooltip: {
formatter: function() { return '<b>'+ this.point.name +'</b><br/>'+this.y+'s<br/>('+Highcharts.numberFormat(this.percentage, 2) +' %)'; }
}
});
});
/**#@- */

54
sql.php
View File

@ -17,11 +17,11 @@ require_once './libraries/bookmark.lib.php';
$GLOBALS['js_include'][] = 'jquery/jquery-ui-1.8.custom.js';
if(isset($_SESSION['profiling'])) {
$GLOBALS['js_include'][] = 'highcharts/highcharts.js';
/* Files required for chart exporting */
$GLOBALS['js_include'][] = 'highcharts/exporting.js';
$GLOBALS['js_include'][] = 'canvg/canvg.js';
$GLOBALS['js_include'][] = 'canvg/rgbcolor.js';
$GLOBALS['js_include'][] = 'highcharts/highcharts.js';
/* Files required for chart exporting */
$GLOBALS['js_include'][] = 'highcharts/exporting.js';
$GLOBALS['js_include'][] = 'canvg/canvg.js';
$GLOBALS['js_include'][] = 'canvg/rgbcolor.js';
}
/**
@ -897,30 +897,30 @@ else {
}
if (isset($profiling_results)) {
echo '<fieldset><legend>' . __('Profiling') . '</legend>' . "\n";
echo '<div style="float: left;">';
echo '<table>' . "\n";
echo ' <tr>' . "\n";
echo ' <th>' . __('Status') . '</th>' . "\n";
echo ' <th>' . __('Time') . '</th>' . "\n";
echo ' </tr>' . "\n";
echo '<fieldset><legend>' . __('Profiling') . '</legend>' . "\n";
echo '<div style="float: left;">';
echo '<table>' . "\n";
echo ' <tr>' . "\n";
echo ' <th>' . __('Status') . '</th>' . "\n";
echo ' <th>' . __('Time') . '</th>' . "\n";
echo ' </tr>' . "\n";
$chart_json = Array();
foreach($profiling_results as $one_result) {
echo ' <tr>' . "\n";
echo '<td>' . ucwords($one_result['Status']) . '</td>' . "\n";
echo '<td align="right">' . (PMA_formatNumber($one_result['Duration'],3,1)) . 's</td>' . "\n";
$chart_json[ucwords($one_result['Status'])] = $one_result['Duration'];
}
$chart_json = Array();
foreach($profiling_results as $one_result) {
echo ' <tr>' . "\n";
echo '<td>' . ucwords($one_result['Status']) . '</td>' . "\n";
echo '<td align="right">' . (PMA_formatNumber($one_result['Duration'],3,1)) . 's</td>' . "\n";
$chart_json[ucwords($one_result['Status'])] = $one_result['Duration'];
}
echo '</table>' . "\n";
echo '</div>';
//require_once './libraries/chart.lib.php';
echo '<div id="profilingchart" style="width:600px; height:400px; float: left;">';
//PMA_chart_profiling($profiling_results);
echo json_encode($chart_json);
echo '</div>';
echo '</fieldset>' . "\n";
echo '</table>' . "\n";
echo '</div>';
//require_once './libraries/chart.lib.php';
echo '<div id="profilingchart" style="width:650px; height:370px; float: left;">';
//PMA_chart_profiling($profiling_results);
echo json_encode($chart_json);
echo '</div>';
echo '</fieldset>' . "\n";
}
// Displays the results in a table