2013-02-01 Miguel de Dios <miguel.dedios@artica.es>

* include/graphs/functions_utils.php: fixed check color and legends
	for stacked graphs when haven't set colors all graphs.
	
	Fixes: #3602725




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7562 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2013-02-01 13:28:49 +00:00
parent 70502d2ce9
commit cc2cf11837
2 changed files with 28 additions and 22 deletions

View File

@ -1,3 +1,10 @@
2013-02-01 Miguel de Dios <miguel.dedios@artica.es>
* include/graphs/functions_utils.php: fixed check color and legends
for stacked graphs when haven't set colors all graphs.
Fixes: #3602725
2013-02-01 Sergio Martin <sergio.martin@artica.es> 2013-02-01 Sergio Martin <sergio.martin@artica.es>
* include/functions_ui.php * include/functions_ui.php

View File

@ -33,10 +33,10 @@ function unserialize_in_temp($serial_id = null, $delete = true, $ttl = 1) {
$volume = -1; $volume = -1;
for($i = 1 ; $i <= $ttl ; $i++) { for ($i = 1 ; $i <= $ttl ; $i++) {
$file_path = sys_get_temp_dir()."/pandora_serialize_".$serial_id."__".$i."__".$ttl; $file_path = sys_get_temp_dir()."/pandora_serialize_".$serial_id."__".$i."__".$ttl;
if(file_exists($file_path)) { if (file_exists($file_path)) {
$volume = $i; $volume = $i;
break; break;
} }
@ -75,8 +75,8 @@ function delete_unserialize_in_temp($serial_id = null) {
function reverse_data($array) { function reverse_data($array) {
$array2 = array(); $array2 = array();
foreach($array as $index => $values) { foreach ($array as $index => $values) {
foreach($values as $index2 => $value) { foreach ($values as $index2 => $value) {
$array2[$index2][$index] = $value; $array2[$index2][$index] = $value;
} }
} }
@ -92,10 +92,10 @@ function stack_data(&$chart_data, &$legend = null, &$color = null) {
$chart_data[$val_x][$graph] += $prev_val; $chart_data[$val_x][$graph] += $prev_val;
$prev_val = $chart_data[$val_x][$graph]; $prev_val = $chart_data[$val_x][$graph];
$temp_data[$val_x][$key] = $chart_data[$val_x][$graph]; $temp_data[$val_x][$key] = $chart_data[$val_x][$graph];
if (isset($color)) { if (isset($color[$graph])) {
$temp_color[$key] = $color[$graph]; $temp_color[$key] = $color[$graph];
} }
if (isset($legend)) { if (isset($legend[$graph])) {
$temp_legend[$key] = $legend[$graph]; $temp_legend[$key] = $legend[$graph];
} }
$key--; $key--;
@ -121,7 +121,7 @@ function graph_get_max_index($legend_values) {
$string_legend = explode("\n",$string_legend); $string_legend = explode("\n",$string_legend);
foreach($string_legend as $st_lg) { foreach ($string_legend as $st_lg) {
$len = strlen($st_lg); $len = strlen($st_lg);
if ($len > $max_chars) { if ($len > $max_chars) {
$max_chars = $len; $max_chars = $len;
@ -133,23 +133,22 @@ function graph_get_max_index($legend_values) {
} }
function setup_watermark($water_mark, &$water_mark_file, &$water_mark_url) { function setup_watermark($water_mark, &$water_mark_file, &$water_mark_url) {
if(!is_array($water_mark)) { if (!is_array($water_mark)) {
$water_mark['file'] = $water_mark; $water_mark['file'] = $water_mark;
} }
if(isset($water_mark['file'])) { if (isset($water_mark['file'])) {
$water_mark_file = $water_mark['file']; $water_mark_file = $water_mark['file'];
} }
else { else {
$water_mark_file = ''; $water_mark_file = '';
} }
if(isset($water_mark['url'])) { if (isset($water_mark['url'])) {
$water_mark_url = $water_mark['url']; $water_mark_url = $water_mark['url'];
} }
else { else {
$water_mark_url = ''; $water_mark_url = '';
} }
} }
?> ?>