From 0c6012fe58f90b8f5e0dfaf6c021c631a0e3f2a5 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Fri, 29 Apr 2011 09:13:26 +0000 Subject: [PATCH] 2011-04-29 Miguel de Dios * include/functions_graph.php, include/graphs/functions_pchart.php, include/graphs/fgraph.php: back to previous version of Juan Manuel, because he update old version of trunk. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4290 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 6 ++++++ pandora_console/include/functions_graph.php | 6 ++++-- pandora_console/include/graphs/fgraph.php | 5 +++-- .../include/graphs/functions_pchart.php | 17 ++++++++++------- 4 files changed, 23 insertions(+), 11 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 4b8978067c..a7d88886c0 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,9 @@ +2011-04-29 Miguel de Dios + + * include/functions_graph.php, include/graphs/functions_pchart.php, + include/graphs/fgraph.php: back to previous version of Juan Manuel, because + he update old version of trunk. + 2011-04-28 Junichi Satoh * godmode/admin_access_logs.php: Fixed filter parameters are not diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index f76eb85e1f..6e84783eb1 100755 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -770,14 +770,16 @@ function progress_bar2($progress, $width, $height, $title = '', $mode = 1) { "&mode=" . $mode . "&out_of_lim_str=".$out_of_lim_str."&title=".$title."&font=".$config['fontpath']."' />"; } -function graph_sla_slicebar ($id, $period, $sla_min, $sla_max, $daysWeek, $time_from, $time_to, $sla_limit, $width, $height) { +function graph_sla_slicebar ($id, $period, $sla_min, $sla_max, $daysWeek, + $time_from, $time_to, $sla_limit, $width, $height, $home_url) { global $config; $days = json_decode ($daysWeek, true); $data = get_agentmodule_sla_array ($id, $period, $sla_min, $sla_max, $sla_limit, $days, $time_from, $time_to); $colors = array(1 => '#38B800', 2 => '#FFFF00', 3 => '#FF0000', 4 => '#C3C3C3'); - return slicesbar_graph($data, $width, $height, $colors, $config['fontpath'], $config['round_corner']); + return slicesbar_graph($data, $width, $height, $colors, $config['fontpath'], + $config['round_corner'], $home_url); } /** diff --git a/pandora_console/include/graphs/fgraph.php b/pandora_console/include/graphs/fgraph.php index c1c877cecb..aef84a2f48 100755 --- a/pandora_console/include/graphs/fgraph.php +++ b/pandora_console/include/graphs/fgraph.php @@ -92,7 +92,8 @@ function progressbar($progress, $width, $height, $title, $font, $mode = 1, $out_ } -function slicesbar_graph($chart_data, $width, $height, $colors, $font, $round_corner) { +function slicesbar_graph($chart_data, $width, $height, $colors, $font, + $round_corner, $home_url = '') { $graph = array(); $graph['data'] = $chart_data; $graph['width'] = $width; @@ -103,7 +104,7 @@ function slicesbar_graph($chart_data, $width, $height, $colors, $font, $round_co $id_graph = serialize_in_temp($graph); - return ""; + return ""; } function vbar_graph($flash_chart, $chart_data, $width, $height, $color = array(), diff --git a/pandora_console/include/graphs/functions_pchart.php b/pandora_console/include/graphs/functions_pchart.php index f15a3a721c..bc1c523cb3 100755 --- a/pandora_console/include/graphs/functions_pchart.php +++ b/pandora_console/include/graphs/functions_pchart.php @@ -42,7 +42,6 @@ $yaxisname = ''; $legend = null; $colors = null; $font_size = 8; -$force_steps = true; $graph_type = get_parameter('graph_type', ''); @@ -62,16 +61,18 @@ if (!isset($graph)) { $data = $graph['data']; $width = $graph['width']; $height = $graph['height']; - -if (isset($graph['color'])) { +$colors = null; +$force_steps = true; +if (isset($graph['color'])) $colors = $graph['color']; -} -if (isset($graph['legend'])) { +$legend = null; +if (isset($graph['legend'])) $legend = $graph['legend']; -} +$xaxisname = ''; if(isset($graph['xaxisname'])) { $xaxisname = $graph['xaxisname']; } +$yaxisname = ''; if(isset($graph['yaxisname'])) { $yaxisname = $graph['yaxisname']; } @@ -376,6 +377,7 @@ function pch_pie_graph ($graph_type, $data_values, $legend_values, $width, $water_mark_height = 0; $water_mark_width = 0; + if (!empty($water_mark)) { $size_water_mark = getimagesize($water_mark); $water_mark_height = $size_water_mark[1]; @@ -410,6 +412,7 @@ function pch_pie_graph ($graph_type, $data_values, $legend_values, $width, $max_chars = $len; } } + $legend_with_aprox = 32 + (7 * $max_chars); $PieChart->drawPieLegend($width - $legend_with_aprox, 5, array("R"=>255,"G"=>255,"B"=>255, "BoxSize"=>10)); @@ -551,7 +554,7 @@ function pch_bar_graph ($graph_type, $index, $data, $width, $height, $font, "Mode"=>SCALE_MODE_START0, "LabelRotation" => 60); $margin_left = 40; $margin_top = 10; - $margin_bottom = 10 * $max_chars; + $margin_bottom = 8 * $max_chars; break; case "hbar": $scaleSettings = array("GridR"=>200,"GridG"=>200,"GridB"=>200,"DrawSubTicks"=>TRUE,