diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 2c7ea1ffa9..0d8ba86db0 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,11 @@ +2011-04-18 Sergio Martin + + * include/graphs/functions_pchart.php + include/graphs/functions_fsgraph.php + include/graphs/fgraph.php: Fixed flash + area colors and lef margin in horizontal bar + graphs + 2011-04-18 Miguel de Dios * include/functions_graph.php: fixed the legend for to show with human diff --git a/pandora_console/include/graphs/fgraph.php b/pandora_console/include/graphs/fgraph.php index de32e88f1a..500a2b4c9c 100755 --- a/pandora_console/include/graphs/fgraph.php +++ b/pandora_console/include/graphs/fgraph.php @@ -129,7 +129,7 @@ function vbar_graph($flash_chart, $chart_data, $width, $height, $color = array() function threshold_graph($flash_chart, $chart_data, $width, $height) { if($flash_chart) { - echo fs_2d_column_chart ($chart_data, $width, $height); + echo fs_area_chart ($chart_data, $width, $height); } else { echo ""; diff --git a/pandora_console/include/graphs/functions_fsgraph.php b/pandora_console/include/graphs/functions_fsgraph.php index 02a7092354..d866e9cd92 100755 --- a/pandora_console/include/graphs/functions_fsgraph.php +++ b/pandora_console/include/graphs/functions_fsgraph.php @@ -309,7 +309,7 @@ function fs_line_graph($chart_data, $width, $height, $color, $legend, $long_inde } -function fs_area_graph($chart_data, $width, $height, $color, $legend, $long_index, $homeurl = '') { +function fs_area_graph($chart_data, $width, $height, $colors, $legend, $long_index) { global $config; $graph_type = "MSArea2D"; //MSLine is possible also @@ -372,21 +372,22 @@ function fs_area_graph($chart_data, $width, $height, $color, $legend, $long_inde $areaBorderColor = ''; $color = ''; $showAreaBorder = 1; //0 old default - if (isset($color[$i])) { - if (!isset($color[$i]['border'])) { + + if (isset($colors[$i])) { + if (!isset($colors[$i]['border'])) { $showAreaBorder = 1; } - if (isset($color[$i]['alpha'])) { - $alpha = 'alpha=' . $color[$i]['alpha'] . ';'; + if (isset($colors[$i]['alpha'])) { + $alpha = 'alpha=' . $colors[$i]['alpha'] . ';'; } - if (isset($color[$i]['border'])) { - $areaBorderColor = 'areaBorderColor=' . $color[$i]['border'] . ';'; + if (isset($colors[$i]['border'])) { + $areaBorderColor = 'areaBorderColor=' . $colors[$i]['border'] . ';'; } - if (isset($color[$i]['color'])) { - $color = 'color=#' . $color[$i]['color']; + if (isset($colors[$i]['color'])) { + $color = 'color=#' . $colors[$i]['color']; } } diff --git a/pandora_console/include/graphs/functions_pchart.php b/pandora_console/include/graphs/functions_pchart.php index d26ba3e952..c9d7281245 100755 --- a/pandora_console/include/graphs/functions_pchart.php +++ b/pandora_console/include/graphs/functions_pchart.php @@ -60,17 +60,15 @@ if (!isset($graph)) { $data = $graph['data']; $width = $graph['width']; $height = $graph['height']; -$colors = null; -if (isset($graph['color'])) +if (isset($graph['color'])) { $colors = $graph['color']; -$legend = null; -if (isset($graph['legend'])) +} +if (isset($graph['legend'])) { $legend = $graph['legend']; -$xaxisname = ''; +} if(isset($graph['xaxisname'])) { $xaxisname = $graph['xaxisname']; } -$yaxisname = ''; if(isset($graph['yaxisname'])) { $yaxisname = $graph['yaxisname']; } @@ -508,7 +506,7 @@ function pch_bar_graph ($graph_type, $index, $data, $width, $height, $font, $ant break; case "hbar": $scaleSettings = array("GridR"=>200,"GridG"=>200,"GridB"=>200,"DrawSubTicks"=>TRUE,"CycleBackground"=>TRUE, "Mode"=>SCALE_MODE_START0, "Pos"=>SCALE_POS_TOPBOTTOM, "LabelValuesRotation" => 60); - $margin_left = 5 * $max_chars; + $margin_left = 8 * $max_chars; $margin_top = 40; $margin_bottom = 10; break;