From 1cfafe95e53b13bff8aa2b4a85158be17154e950 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Wed, 12 Jun 2013 16:36:46 +0000 Subject: [PATCH] 2013-06-12 Miguel de Dios * include/functions_reporting.php: fixed the empty serialize vars. Fixes: #2276 MERGED FROM THE BRANCH PANDORA_4.0 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8307 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/include/functions_graph.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 18370ccf90..0d9b35742d 100755 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -2311,15 +2311,21 @@ function graph_custom_sql_graph ($id, $width, $height, $type = 'sql_graph_vbar', $count = 0; foreach ($data_result as $data_item) { $count++; + $value = 0; + if (!empty($data_item["value"])) { + $value = $data_item["value"]; + } + $label = __('Data'); + if (!empty($data_item["label"])) { + $label = $data_item["label"]; + } switch ($type) { case 'sql_graph_vbar': // vertical bar - $data[$data_item["label"]]['g'] = $data_item["value"]; - break; case 'sql_graph_hbar': // horizontal bar - $data[$data_item["label"]]['g'] = $data_item["value"]; + $data[$label]['g'] = $value; break; case 'sql_graph_pie': // Pie - $data[$data_item["label"]] = $data_item["value"]; + $data[$label] = $value; break; } }