fixed sql graph pie
This commit is contained in:
parent
2b06c5babc
commit
8c6c4d99a0
|
@ -3737,14 +3737,18 @@ function graph_custom_sql_graph(
|
|||
global $config;
|
||||
|
||||
$SQL_GRAPH_MAX_LABEL_SIZE = 20;
|
||||
|
||||
if (is_metaconsole() && $content['server_name'] !== '0') {
|
||||
$server = metaconsole_get_connection_names();
|
||||
$connection = metaconsole_get_connection($server);
|
||||
if (is_metaconsole() === true
|
||||
&& empty($content['server_name']) === false
|
||||
) {
|
||||
$connection = metaconsole_get_connection($content['server_name']);
|
||||
metaconsole_connect($connection);
|
||||
}
|
||||
|
||||
$report_content = db_get_row('treport_content', 'id_rc', $content['id_rc']);
|
||||
$report_content = db_get_row(
|
||||
'treport_content',
|
||||
'id_rc',
|
||||
$content['id_rc']
|
||||
);
|
||||
|
||||
if ($report_content == false || $report_content == '') {
|
||||
$report_content = db_get_row(
|
||||
|
@ -3755,7 +3759,9 @@ function graph_custom_sql_graph(
|
|||
}
|
||||
|
||||
if ($report_content == false || $report_content == '') {
|
||||
if (is_metaconsole() && $content['server_name'] !== '0') {
|
||||
if (is_metaconsole() === true
|
||||
&& empty($content['server_name']) === false
|
||||
) {
|
||||
enterprise_hook('metaconsole_restore_db');
|
||||
}
|
||||
|
||||
|
@ -3772,9 +3778,10 @@ function graph_custom_sql_graph(
|
|||
);
|
||||
}
|
||||
|
||||
if ((is_metaconsole() & $content['server_name']) !== '0') {
|
||||
$server = metaconsole_get_connection_names();
|
||||
$connection = metaconsole_get_connection($server);
|
||||
if (is_metaconsole() === true
|
||||
&& empty($content['server_name']) === false
|
||||
) {
|
||||
$connection = metaconsole_get_connection($content['server_name']);
|
||||
metaconsole_connect($connection);
|
||||
}
|
||||
}
|
||||
|
@ -3800,7 +3807,7 @@ function graph_custom_sql_graph(
|
|||
|
||||
$data_result = db_get_all_rows_sql($sql, $historical_db);
|
||||
|
||||
if ((is_metaconsole() & $content['server_name']) !== '0') {
|
||||
if (is_metaconsole() === true && empty($content['server_name']) === false) {
|
||||
enterprise_hook('metaconsole_restore_db');
|
||||
}
|
||||
|
||||
|
@ -3908,6 +3915,7 @@ function graph_custom_sql_graph(
|
|||
];
|
||||
}
|
||||
|
||||
$output = '';
|
||||
switch ($type) {
|
||||
case 'sql_graph_vbar':
|
||||
default:
|
||||
|
@ -3936,12 +3944,11 @@ function graph_custom_sql_graph(
|
|||
$output .= vbar_graph($data, $options, $ttl);
|
||||
$output .= '</div>';
|
||||
}
|
||||
return $output;
|
||||
|
||||
break;
|
||||
|
||||
case 'sql_graph_hbar':
|
||||
// Horizontal bar.
|
||||
return hbar_graph(
|
||||
$output .= hbar_graph(
|
||||
$data,
|
||||
$width,
|
||||
$height,
|
||||
|
@ -3960,11 +3967,11 @@ function graph_custom_sql_graph(
|
|||
'white',
|
||||
'#c1c1c1'
|
||||
);
|
||||
|
||||
break;
|
||||
|
||||
case 'sql_graph_pie':
|
||||
// Pie.
|
||||
return pie_graph(
|
||||
$output .= pie_graph(
|
||||
$data,
|
||||
$width,
|
||||
$height,
|
||||
|
@ -3975,9 +3982,10 @@ function graph_custom_sql_graph(
|
|||
$config['font_size'],
|
||||
$ttl
|
||||
);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue