Fixed gauge graphs in visual console. Ticket 4 (gitlab)

This commit is contained in:
Arturo Gonzalez 2016-07-21 08:45:52 +02:00
parent d41024451c
commit 29dfd3df9b
1 changed files with 13 additions and 6 deletions

View File

@ -787,24 +787,31 @@ switch ($action) {
break; break;
case 'module_graph': case 'module_graph':
$values['type'] = MODULE_GRAPH; $values['type'] = MODULE_GRAPH;
if ($values['id_custom_graph'] > 0 ) { if ($values['id_custom_graph'] > 0 ) {
$values['height'] = $height_module_graph; $values['height'] = $height_module_graph;
$values['width'] = $width_module_graph; $values['width'] = $width_module_graph;
$graph_conf = db_get_row('tgraph', 'id_graph', $values['id_custom_graph']); $graph_conf = db_get_row('tgraph', 'id_graph', $values['id_custom_graph']);
$graph_stacked = $graph_conf['stacked']; $graph_stacked = $graph_conf['stacked'];
if ( $graph_stacked == CUSTOM_GRAPH_BULLET_CHART) { if ( $graph_stacked == CUSTOM_GRAPH_BULLET_CHART) {
$values['height'] = 50; $values['height'] = 50;
} }
elseif ($graph_stacked == CUSTOM_GRAPH_GAUGE ){ elseif ($graph_stacked == CUSTOM_GRAPH_GAUGE ){
if ( $height_module_graph < 150 ) if ( $height_module_graph < 150 ) {
$values['height'] = 150; $values['height'] = 150;
elseif( $height_module_graph >= 150 && $height_module_graph < 250 ) }
$values['height'] = $graph_height; elseif(($height_module_graph >= 150)
elseif( $height_module_graph >= 250 ) && ($height_module_graph < 250)) {
$values['height'] = 200; $values['height'] = $graph_conf['height'];
}
elseif( $height_module_graph >= 250 ) {
$values['height'] = 200;
}
} }
} else { }
else {
$values['height'] = $height_module_graph; $values['height'] = $height_module_graph;
$values['width'] = $width_module_graph; $values['width'] = $width_module_graph;
} }