2011-08-30 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_graph.php, include/graphs/functions_fsgraph.php, include/graphs/fgraph.php: added the parameter $reduce_data_columns by default false for to use in vertical columns graph. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4850 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
b6adf426b3
commit
5e4e2893b0
|
@ -1,3 +1,9 @@
|
|||
2011-08-30 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* include/functions_graph.php, include/graphs/functions_fsgraph.php,
|
||||
include/graphs/fgraph.php: added the parameter $reduce_data_columns by
|
||||
default false for to use in vertical columns graph.
|
||||
|
||||
2011-08-30 Sergio Martin <sergio.martin@artica.es>
|
||||
|
||||
* operation/agentes/estado_agente.php: Fixed URL injection replacing
|
||||
|
|
|
@ -2075,18 +2075,10 @@ function grafico_modulo_string ($agent_module_id, $period, $show_events,
|
|||
|
||||
$legend = null;
|
||||
|
||||
//TODO FIX
|
||||
|
||||
return vbar_graph($flash_chart, $chart, $width, $height, $color,
|
||||
$legend, "", "", $homeurl,
|
||||
$config['homedir'] . "/images/logo_vertical_water.png",
|
||||
$config['fontpath'], $config['font_size']);
|
||||
|
||||
//old
|
||||
return area_graph($flash_chart, $chart, $width, $height, $color, $legend,
|
||||
$long_index, "images/image_problem.opaque.png", "", "", $homeurl,
|
||||
$config['homedir'] . "/images/logo_vertical_water.png",
|
||||
$config['fontpath'], $config['font_size'], "");
|
||||
$config['fontpath'], $config['font_size'], '', true, 1, true);
|
||||
}
|
||||
|
||||
function grafico_modulo_log4x ($id_agente_modulo, $periodo, $show_event,
|
||||
|
|
|
@ -156,10 +156,10 @@ function slicesbar_graph($chart_data, $period, $width, $height, $colors, $font,
|
|||
|
||||
function vbar_graph($flash_chart, $chart_data, $width, $height, $color = array(),
|
||||
$legend = array(), $xaxisname = "", $yaxisname = "", $homedir="",
|
||||
$water_mark = '', $font = '', $font_size = '', $force_steps = true, $ttl = 1) {
|
||||
$water_mark = '', $font = '', $font_size = '', $force_steps = true, $ttl = 1, $reduce_data_columns = false) {
|
||||
|
||||
if($flash_chart) {
|
||||
echo fs_2d_column_chart ($chart_data, $width, $height, $homedir);
|
||||
echo fs_2d_column_chart ($chart_data, $width, $height, $homedir, $reduce_data_columns);
|
||||
}
|
||||
else {
|
||||
$graph = array();
|
||||
|
|
|
@ -520,7 +520,7 @@ function fs_2d_pie_chart ($data, $names, $width, $height, $background = "EEEEEE"
|
|||
}
|
||||
|
||||
// Returns a 2D column chart
|
||||
function fs_2d_column_chart ($data, $width, $height, $homeurl = '') {
|
||||
function fs_2d_column_chart ($data, $width, $height, $homeurl = '', $reduce_data_columns = false) {
|
||||
if (sizeof ($data) == 0) {
|
||||
return;
|
||||
}
|
||||
|
@ -549,15 +549,23 @@ function fs_2d_column_chart ($data, $width, $height, $homeurl = '') {
|
|||
if (($count % $step) == 0) {
|
||||
$show_name = '1';
|
||||
}
|
||||
|
||||
|
||||
$chart->addCategory($i, //'');
|
||||
'hoverText=' . $i .
|
||||
';showName=' . $show_name);
|
||||
|
||||
$c = 0;
|
||||
$previous = false;
|
||||
foreach($values as $i2 => $value) {
|
||||
if ($reduce_data_columns) {
|
||||
if ($previous !== false) {
|
||||
if ($previous == $value) continue;
|
||||
}
|
||||
}
|
||||
$data2[$i2][$i] = $value;
|
||||
$c++;
|
||||
|
||||
$previous = $value;
|
||||
}
|
||||
}
|
||||
$data = $data2;
|
||||
|
|
Loading…
Reference in New Issue