2012-04-16 Sergio Martin <sergio.martin@artica.es>

* include/graphs/fgraph.php
	include/functions_visual_map.php: Improved the 
	min size of the area graphs and clean code



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5984 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
zarzuelo 2012-04-16 15:34:54 +00:00
parent 2ddbea117c
commit a668e7a00e
3 changed files with 31 additions and 23 deletions

View File

@ -1,3 +1,9 @@
2012-04-16 Sergio Martin <sergio.martin@artica.es>
* include/graphs/fgraph.php
include/functions_visual_map.php: Improved the
min size of the area graphs and clean code
2012-04-16 Juan Manuel Ramon <juanmanuel.ramon@artica.es> 2012-04-16 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/styles/dialog.css * include/styles/dialog.css

View File

@ -1018,7 +1018,7 @@ function visual_map_print_visual_map ($id_layout, $show_links = true, $draw_line
// **************************************************************** // ****************************************************************
// SIMPLE DATA VALUE (type = 2) // SIMPLE DATA VALUE (type = 2)
// **************************************************************** // ****************************************************************
$unit_text = db_get_sql ('SELECT unit FROM tagente_modulo WHERE id_agente_modulo = ' . $id_module); $unit_text = db_get_sql ('SELECT unit FROM tagente_modulo WHERE id_agente_modulo = ' . $layout_data['id_agente_modulo']);
$unit_text = trim(io_safe_output($unit_text)); $unit_text = trim(io_safe_output($unit_text));
if ($resizedMap) if ($resizedMap)
@ -1227,11 +1227,16 @@ function visual_map_print_visual_map ($id_layout, $show_links = true, $draw_line
// **************************************************************** // ****************************************************************
// Single module graph // Single module graph
// **************************************************************** // ****************************************************************
// SINGLE GRAPH (type = 1) // SINGLE GRAPH (type = 1)
if ($resizedMap)
echo '<div style="left: 0px; top: 0px; text-align: center; z-index: 1; color: '.$layout_data['label_color'].'; position: absolute; margin-left: '.((integer)($proportion * $layout_data['pos_x'])).'px; margin-top:'.((integer)($proportion * $layout_data['pos_y'])).'px;" id="layout-data-'.$layout_data['id'].'" class="layout-data">'; if ($resizedMap) {
else $layout_data['width'] = ((integer)($proportion * $layout_data['width']));
echo '<div style="left: 0px; top: 0px; text-align: center; z-index: 1; color: '.$layout_data['label_color'].'; position: absolute; margin-left: '.$layout_data['pos_x'].'px; margin-top:'.$layout_data['pos_y'].'px;" id="layout-data-'.$layout_data['id'].'" class="layout-data">'; $layout_data['height'] = ((integer)($proportion * $layout_data['height']));
$layout_data['pos_x'] = ((integer)($proportion * $layout_data['pos_x']));
$layout_data['pos_y'] = ((integer)($proportion * $layout_data['pos_y']));
}
echo '<div style="left: 0px; top: 0px; text-align: center; z-index: 1; color: '.$layout_data['label_color'].'; position: absolute; margin-left: '.$layout_data['pos_x'].'px; margin-top:'.$layout_data['pos_y'].'px;" id="layout-data-'.$layout_data['id'].'" class="layout-data">';
echo $layout_data['label']; echo $layout_data['label'];
echo "<br>"; echo "<br>";
@ -1263,20 +1268,13 @@ function visual_map_print_visual_map ($id_layout, $show_links = true, $draw_line
echo '<a href="index.php?sec=visualc&amp;sec2=operation/visual_console/render_view&amp;pure='.$config["pure"].'&amp;id='.$layout_data['id_layout_linked'].'">'; echo '<a href="index.php?sec=visualc&amp;sec2=operation/visual_console/render_view&amp;pure='.$config["pure"].'&amp;id='.$layout_data['id_layout_linked'].'">';
} }
} }
if ($resizedMap) { // ATTENTION: DO NOT USE &amp; here because is bad-translated and doesnt work
// ATTENTION: DO NOT USE &amp; here because is bad-translated and doesnt work // resulting fault image links :(
// resulting fault image links :( echo grafico_modulo_sparse ($layout_data['id_agente_modulo'], $layout_data['period'],
false, $layout_data['width'], $layout_data['height'],
echo grafico_modulo_sparse ($layout_data['id_agente_modulo'], $layout_data['period'], '', null, false, 1, false, 0, '', 0, 0, true, true, $home_url, 2);
false, ((integer)($proportion * $layout_data['width'])), ((integer)($proportion * $layout_data['height'])),
'', null, false, 1, false, 0, '', 0, 0, true, true, $home_url);
}
else {
echo grafico_modulo_sparse ($layout_data['id_agente_modulo'], $layout_data['period'],
false, $layout_data['width'], $layout_data['height'],
'', null, false, 1, false, 0, '', 0, 0, true, true, $home_url);
}
echo "</a>"; echo "</a>";
echo "</div>"; echo "</div>";
break; break;

View File

@ -227,9 +227,13 @@ function area_graph($flash_chart, $chart_data, $width, $height, $color, $legend,
setup_watermark($water_mark, $water_mark_file, $water_mark_url); setup_watermark($water_mark, $water_mark_file, $water_mark_url);
// ATTENTION: The min height is 101 // ATTENTION: The min size is 130x150
if($height <= 100) { // It's not the same minsize for all graphs, but we are choosed a prudent minsize for all
$height = 101; if($height <= 130) {
$height = 130;
}
if($width < 150) {
$width = 150;
} }
if (empty($chart_data)) { if (empty($chart_data)) {