From 3a215820c174d256550b99c5bd606db95c4f9425 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Mon, 14 Oct 2013 11:48:51 +0000 Subject: [PATCH] 2013-10-14 Miguel de Dios * include/graphs/flot/pandora.flot.js, include/graphs/functions_flot.php, operation/agentes/stat_win.php: fixed the charts with negative values and a flot type. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8906 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 6 ++ .../include/graphs/flot/pandora.flot.js | 83 ++++++++++--------- .../include/graphs/functions_flot.php | 40 +++++++-- .../operation/agentes/stat_win.php | 1 + 4 files changed, 86 insertions(+), 44 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 9297f279e3..cee94ae512 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,9 @@ +2013-10-14 Miguel de Dios + + * include/graphs/flot/pandora.flot.js, + include/graphs/functions_flot.php, operation/agentes/stat_win.php: + fixed the charts with negative values and a flot type. + 2013-10-14 Vanessa Gil * include/languages/ar.mo diff --git a/pandora_console/include/graphs/flot/pandora.flot.js b/pandora_console/include/graphs/flot/pandora.flot.js index 5592a0c644..b01c867e3f 100644 --- a/pandora_console/include/graphs/flot/pandora.flot.js +++ b/pandora_console/include/graphs/flot/pandora.flot.js @@ -546,12 +546,12 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, colors, // Prepared to turn series with a checkbox // var showed = new Array(); - for(i=0;i $values) { $labels[] = io_safe_output($label); - + foreach($values as $key => $value) { - $jsvar = "data_".$graph_id."_".$key; + $jsvar = "data_" . $graph_id . "_" . $key; if (!isset($serie_types[$key])) { $serie_types2[$jsvar] = 'line'; @@ -298,14 +298,42 @@ function flot_area_graph($chart_data, $width, $height, $color, $legend, $long_in else { $force_integer = 'false'; } - + // Trick to get translated string from javascript - $return .= html_print_input_hidden('unknown_text', __('Unknown'), true); + $return .= html_print_input_hidden('unknown_text', __('Unknown'), + true); // Javascript code $return .= ""; diff --git a/pandora_console/operation/agentes/stat_win.php b/pandora_console/operation/agentes/stat_win.php index 0e6d62356c..58af6cbc4b 100644 --- a/pandora_console/operation/agentes/stat_win.php +++ b/pandora_console/operation/agentes/stat_win.php @@ -161,6 +161,7 @@ $label = base64_decode(get_parameter('label', '')); echo '
'; else echo '
'; + switch ($graph_type) { case 'boolean': echo grafico_modulo_boolean ($id, $period, $draw_events, $width, $height,