2011-04-29 Miguel de Dios <miguel.dedios@artica.es>

* 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
This commit is contained in:
mdtrooper 2011-04-29 09:13:26 +00:00
parent 2bcd7e8386
commit 6f8c488ffe
4 changed files with 23 additions and 11 deletions

View File

@ -1,3 +1,9 @@
2011-04-29 Miguel de Dios <miguel.dedios@artica.es>
* 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 <junichi@rworks.jp> 2011-04-28 Junichi Satoh <junichi@rworks.jp>
* godmode/admin_access_logs.php: Fixed filter parameters are not * godmode/admin_access_logs.php: Fixed filter parameters are not

View File

@ -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']."' />"; "&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; global $config;
$days = json_decode ($daysWeek, true); $days = json_decode ($daysWeek, true);
$data = get_agentmodule_sla_array ($id, $period, $sla_min, $sla_max, $sla_limit, $days, $time_from, $time_to); $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'); $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);
} }
/** /**

View File

@ -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 = array();
$graph['data'] = $chart_data; $graph['data'] = $chart_data;
$graph['width'] = $width; $graph['width'] = $width;
@ -103,7 +104,7 @@ function slicesbar_graph($chart_data, $width, $height, $colors, $font, $round_co
$id_graph = serialize_in_temp($graph); $id_graph = serialize_in_temp($graph);
return "<img src='include/graphs/functions_pchart.php?graph_type=slicebar&id_graph=".$id_graph."'>"; return "<img src='".$home_url."include/graphs/functions_pchart.php?graph_type=slicebar&id_graph=".$id_graph."'>";
} }
function vbar_graph($flash_chart, $chart_data, $width, $height, $color = array(), function vbar_graph($flash_chart, $chart_data, $width, $height, $color = array(),

View File

@ -42,7 +42,6 @@ $yaxisname = '';
$legend = null; $legend = null;
$colors = null; $colors = null;
$font_size = 8; $font_size = 8;
$force_steps = true;
$graph_type = get_parameter('graph_type', ''); $graph_type = get_parameter('graph_type', '');
@ -62,16 +61,18 @@ if (!isset($graph)) {
$data = $graph['data']; $data = $graph['data'];
$width = $graph['width']; $width = $graph['width'];
$height = $graph['height']; $height = $graph['height'];
$colors = null;
if (isset($graph['color'])) { $force_steps = true;
if (isset($graph['color']))
$colors = $graph['color']; $colors = $graph['color'];
} $legend = null;
if (isset($graph['legend'])) { if (isset($graph['legend']))
$legend = $graph['legend']; $legend = $graph['legend'];
} $xaxisname = '';
if(isset($graph['xaxisname'])) { if(isset($graph['xaxisname'])) {
$xaxisname = $graph['xaxisname']; $xaxisname = $graph['xaxisname'];
} }
$yaxisname = '';
if(isset($graph['yaxisname'])) { if(isset($graph['yaxisname'])) {
$yaxisname = $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_height = 0;
$water_mark_width = 0; $water_mark_width = 0;
if (!empty($water_mark)) { if (!empty($water_mark)) {
$size_water_mark = getimagesize($water_mark); $size_water_mark = getimagesize($water_mark);
$water_mark_height = $size_water_mark[1]; $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; $max_chars = $len;
} }
} }
$legend_with_aprox = 32 + (7 * $max_chars); $legend_with_aprox = 32 + (7 * $max_chars);
$PieChart->drawPieLegend($width - $legend_with_aprox, 5, array("R"=>255,"G"=>255,"B"=>255, "BoxSize"=>10)); $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); "Mode"=>SCALE_MODE_START0, "LabelRotation" => 60);
$margin_left = 40; $margin_left = 40;
$margin_top = 10; $margin_top = 10;
$margin_bottom = 10 * $max_chars; $margin_bottom = 8 * $max_chars;
break; break;
case "hbar": case "hbar":
$scaleSettings = array("GridR"=>200,"GridG"=>200,"GridB"=>200,"DrawSubTicks"=>TRUE, $scaleSettings = array("GridR"=>200,"GridG"=>200,"GridB"=>200,"DrawSubTicks"=>TRUE,