2011-04-06 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_graph.php: wip in the function "graphic_combined_module2". * include/graphs/functions_fsgraph.php: fixed when "fs_area_graph" when send a graph without the colours or and legend. * include/graphs/fgraph.php: erased lost session instructions in the function "area_graph". git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4175 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
a5ed5b3571
commit
ee963b0ae0
|
@ -1,3 +1,13 @@
|
|||
2011-04-06 Miguel de Dios <miguel.dedios@artica.es>
|
||||
* include/functions_graph.php: wip in the function
|
||||
"graphic_combined_module2".
|
||||
|
||||
* include/graphs/functions_fsgraph.php: fixed when "fs_area_graph" when
|
||||
send a graph without the colours or and legend.
|
||||
|
||||
* include/graphs/fgraph.php: erased lost session instructions in the
|
||||
function "area_graph".
|
||||
|
||||
2011-04-06 Javier Lanz <javier.lanz@artica.es>
|
||||
|
||||
* include/functions_reporting.php: Added case to display 'agent_module'
|
||||
|
|
|
@ -425,7 +425,10 @@ function graphic_combined_module2 ($module_list, $weight_list, $period, $width,
|
|||
$k = 0;
|
||||
|
||||
// Set initial conditions
|
||||
$graph_values[$i] = array();
|
||||
|
||||
//$graph_values[$i] = array();
|
||||
$temp_graph_values = array();
|
||||
|
||||
if ($data[0]['utimestamp'] == $datelimit) {
|
||||
$previous_data = $data[0]['datos'];
|
||||
$j++;
|
||||
|
@ -474,23 +477,48 @@ function graphic_combined_module2 ($module_list, $weight_list, $period, $width,
|
|||
|
||||
// Data
|
||||
if ($count > 0) {
|
||||
$graph_values[$i][$timestamp] = $total * $weight_list[$i];
|
||||
//$graph_values[$i][$timestamp] = $total * $weight_list[$i];
|
||||
$temp_graph_values[$timestamp] = $total * $weight_list[$i];
|
||||
|
||||
$previous_data = $total;
|
||||
// Compressed data
|
||||
} else {
|
||||
if ($uncompressed_module || ($timestamp > time ())) {
|
||||
$graph_values[$i][$timestamp] = 0;
|
||||
} else {
|
||||
$graph_values[$i][$timestamp] = $previous_data * $weight_list[$i];
|
||||
//$graph_values[$i][$timestamp] = 0;
|
||||
$temp_graph_values[$timestamp] = 0;
|
||||
}
|
||||
else {
|
||||
//$graph_values[$i][$timestamp] = $previous_data * $weight_list[$i];
|
||||
$temp_graph_values[$timestamp] = $previous_data * $weight_list[$i];
|
||||
}
|
||||
}
|
||||
|
||||
$graph_values[$i] = $temp_graph_values;
|
||||
}
|
||||
|
||||
if ($weight_list[$i] != 1) {
|
||||
$module_name_list[$i] .= " (x". format_numeric ($weight_list[$i], 1).")";
|
||||
}
|
||||
|
||||
$graph_values[$module_name_list[$i]] = $graph_values[$i];
|
||||
unset($graph_values[$i]);
|
||||
}
|
||||
|
||||
$temp = array(); //debugPrint($graph_values);
|
||||
foreach ($graph_values as $graph_group => $point) {
|
||||
foreach ($point as $timestamp_point => $point_value) {
|
||||
$temp[$timestamp_point][$graph_group] = $point_value;
|
||||
}
|
||||
}
|
||||
$graph_values = $temp;
|
||||
|
||||
/*
|
||||
for ($i = 0; $i < $module_number; $i++) {
|
||||
if ($weight_list[$i] != 1)
|
||||
if ($weight_list[$i] != 1) {
|
||||
$module_name_list[$i] .= " (x". format_numeric ($weight_list[$i], 1).")";
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
if ($period <= 3600) {
|
||||
$title_period = __('Last hour');
|
||||
|
@ -512,7 +540,7 @@ function graphic_combined_module2 ($module_list, $weight_list, $period, $width,
|
|||
switch ($stacked) {
|
||||
case 0:
|
||||
return area_graph($config['flash_charts'], $graph_values, $width, $height,
|
||||
$color, $legend, $long_index);
|
||||
array(), $module_name_list, array());
|
||||
return;
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -58,7 +58,6 @@ function area_graph($flash_chart, $chart_data, $width, $height, $color,$legend,
|
|||
$graph['legend'] = $legend;
|
||||
|
||||
serialize_in_temp($graph, $id_graph);
|
||||
session_write_close();
|
||||
|
||||
return "<img src='http://127.0.0.1/pandora_console/include/graphs/functions_pchart.php?graph_type=area&id_graph=" . $id_graph . "'>";
|
||||
}
|
||||
|
|
|
@ -70,9 +70,11 @@ function fs_area_graph($chart_data, $width, $height, $color, $legend, $long_inde
|
|||
$show_name = '1';
|
||||
}
|
||||
|
||||
$chart->addCategory($i, //'');
|
||||
'hoverText=' . $long_index[$i] .
|
||||
';showName=' . $show_name);
|
||||
if (isset($long_index[$i])) {
|
||||
$chart->addCategory($i, //'');
|
||||
'hoverText=' . $long_index[$i] .
|
||||
';showName=' . $show_name);
|
||||
}
|
||||
|
||||
$c = 0;
|
||||
foreach($values as $i2 => $value) {
|
||||
|
@ -90,15 +92,38 @@ function fs_area_graph($chart_data, $width, $height, $color, $legend, $long_inde
|
|||
|
||||
$empty = 1;
|
||||
foreach ($data as $i => $value) {
|
||||
$showAreaBorder = 0;
|
||||
if (!is_null($color[$i]['border'])) {
|
||||
$showAreaBorder = 1;
|
||||
|
||||
$legend = '';
|
||||
if (isset($legend[$i])) {
|
||||
$legend = $legend[$i];
|
||||
}
|
||||
|
||||
$chart->addDataSet($legend[$i], 'alpha=' . $color[$i]['alpha'] . ';' .
|
||||
$alpha = '';
|
||||
$areaBorderColor = '';
|
||||
$color = '';
|
||||
$showAreaBorder = 0;
|
||||
if (isset($color[$i])) {
|
||||
if (!isset($color[$i]['border'])) {
|
||||
$showAreaBorder = 1;
|
||||
}
|
||||
|
||||
if (isset($color[$i]['alpha'])) {
|
||||
$alpha = 'alpha=' . $color[$i]['alpha'] . ';';
|
||||
}
|
||||
|
||||
if (isset($color[$i]['border'])) {
|
||||
$areaBorderColor = 'areaBorderColor=' . $color[$i]['border'] . ';';
|
||||
}
|
||||
|
||||
if (isset($color[$i]['color'])) {
|
||||
$color = 'color=#' . $color[$i]['color'];
|
||||
}
|
||||
}
|
||||
|
||||
$chart->addDataSet($legend, $alpha .
|
||||
'showAreaBorder=' . $showAreaBorder . ';' .
|
||||
'areaBorderColor=' . $color[$i]['border'] . ';' .
|
||||
'color=#' . $color[$i]['color']);
|
||||
$areaBorderColor .
|
||||
$color);
|
||||
|
||||
$count = 0;
|
||||
$step = 10;
|
||||
|
|
Loading…
Reference in New Issue