diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 0d9135cfea..ce456e40ea 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,10 @@ +2011-04-11 Sergio Martin + + * include/graphs/functions_pchart.php + include/graphs/functions_fsgraph.php + include/graphs/fgraph.php: Merged changes from integria like increasement + of margins in area static graphs, clean code and minor fixes + 2011-04-09 Manuel Arostegui * pandoradb.sql: Added index to tagente_modulo. diff --git a/pandora_console/include/graphs/fgraph.php b/pandora_console/include/graphs/fgraph.php index f745764df3..b02891f809 100755 --- a/pandora_console/include/graphs/fgraph.php +++ b/pandora_console/include/graphs/fgraph.php @@ -13,20 +13,20 @@ include_once('functions_fsgraph.php'); include_once('functions_utils.php'); -function vbar_graph($flash_chart, $chart_data, $width, $height, $color, $legend) { +function vbar_graph($flash_chart, $chart_data, $width, $height, $color = array(), $legend = array(), $xaxisname = "", $yaxisname = "") { if($flash_chart) { echo fs_2d_column_chart ($chart_data, $width, $height); } else { - $id_graph = uniqid(); - $graph = array(); $graph['data'] = $chart_data; $graph['width'] = $width; $graph['height'] = $height; $graph['color'] = $color; $graph['legend'] = $legend; - + $graph['xaxisname'] = $xaxisname; + $graph['yaxisname'] = $yaxisname; + $id_graph = serialize_in_temp($graph); echo ""; @@ -42,14 +42,13 @@ function threshold_graph($flash_chart, $chart_data, $width, $height) { } } -function area_graph($flash_chart, $chart_data, $width, $height, $color,$legend, $long_index) { +function area_graph($flash_chart, $chart_data, $width, $height, $color, $legend, $long_index) { if($flash_chart) { return fs_area_graph($chart_data, $width, $height, $color, $legend, $long_index); } else { $id_graph = uniqid(); - $graph = array(); $graph['data'] = $chart_data; $graph['width'] = $width; @@ -58,8 +57,8 @@ function area_graph($flash_chart, $chart_data, $width, $height, $color,$legend, $graph['legend'] = $legend; serialize_in_temp($graph, $id_graph); - - return ""; + + return ""; } } @@ -145,12 +144,23 @@ function line_graph($flash_chart, $chart_data, $width, $height, $color, $legend, } } -function hbar_graph($flash_chart, $chart_data, $width, $height) { +function hbar_graph($flash_chart, $chart_data, $width, $height, $color = array(), $legend = array(), $xaxisname = "", $yaxisname = "") { if($flash_chart) { echo fs_hbar_chart (array_values($chart_data), array_keys($chart_data), $width, $height); } else { - echo ""; + $graph = array(); + $graph['data'] = $chart_data; + $graph['width'] = $width; + $graph['height'] = $height; + $graph['color'] = $color; + $graph['legend'] = $legend; + $graph['xaxisname'] = $xaxisname; + $graph['yaxisname'] = $yaxisname; + + $id_graph = serialize_in_temp($graph); + + echo ""; } } @@ -181,23 +191,34 @@ function pie_graph($graph_type, $flash_chart, $chart_data, $width, $height, $oth $chart_data = $chart_data_trunc; } - switch($graph_type) { - case "2d": - if($flash_chart) { + if($flash_chart) { + switch($graph_type) { + case "2d": return fs_2d_pie_chart (array_values($chart_data), array_keys($chart_data), $width, $height); - } - else { - return ""; - } break; - case "3d": - if($flash_chart) { + case "3d": return fs_3d_pie_chart (array_values($chart_data), array_keys($chart_data), $width, $height); - } - else { - return ""; - } break; + } + } + else { + $graph = array(); + $graph['data'] = $chart_data; + $graph['width'] = $width; + $graph['height'] = $height; + $graph['color'] = $color; + $graph['legend'] = $legend; + + $id_graph = serialize_in_temp($graph); + + switch($graph_type) { + case "2d": + return ""; + break; + case "3d": + return ""; + break; + } } } diff --git a/pandora_console/include/graphs/functions_fsgraph.php b/pandora_console/include/graphs/functions_fsgraph.php index 04f93028db..1117605c1c 100755 --- a/pandora_console/include/graphs/functions_fsgraph.php +++ b/pandora_console/include/graphs/functions_fsgraph.php @@ -159,15 +159,13 @@ function fs_stacked_graph($chart_data, $width, $height, $color, $legend, $long_i $div_id = 'chart_div_' . $random_number; $chart_id = 'chart_' . $random_number; - - $pre_url = ($config["homeurl"] == "/") ? '' : $config["homeurl"]; - + $output = '
'; - $output .= ''; + $output .= ''; $output .= '