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 f582477c0d
commit 1c60e0bc06
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>
* 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)
// ****************************************************************
$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));
if ($resizedMap)
@ -1228,10 +1228,15 @@ function visual_map_print_visual_map ($id_layout, $show_links = true, $draw_line
// Single module graph
// ****************************************************************
// 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">';
else
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">';
if ($resizedMap) {
$layout_data['width'] = ((integer)($proportion * $layout_data['width']));
$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 "<br>";
@ -1264,19 +1269,12 @@ function visual_map_print_visual_map ($id_layout, $show_links = true, $draw_line
}
}
if ($resizedMap) {
// ATTENTION: DO NOT USE &amp; here because is bad-translated and doesnt work
// resulting fault image links :(
// ATTENTION: DO NOT USE &amp; here because is bad-translated and doesnt work
// resulting fault image links :(
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, 2);
echo grafico_modulo_sparse ($layout_data['id_agente_modulo'], $layout_data['period'],
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 "</div>";
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);
// ATTENTION: The min height is 101
if($height <= 100) {
$height = 101;
// ATTENTION: The min size is 130x150
// It's not the same minsize for all graphs, but we are choosed a prudent minsize for all
if($height <= 130) {
$height = 130;
}
if($width < 150) {
$width = 150;
}
if (empty($chart_data)) {