From 6bf17948f8ba7a1bb9f91f784d93640b2d646bfc Mon Sep 17 00:00:00 2001 From: zarzuelo Date: Wed, 13 Feb 2013 09:41:59 +0000 Subject: [PATCH] 2013-02-13 Sergio Martin * include/graphs/functions_flot.php include/graphs/flot/pandora.flot.js operation/agentes/stat_win.php: Improve the legend of the interactive graphs for bug 3573814 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7640 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 7 +++++++ pandora_console/include/graphs/flot/pandora.flot.js | 3 ++- pandora_console/include/graphs/functions_flot.php | 3 +++ pandora_console/operation/agentes/stat_win.php | 6 ++++-- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 4a565859b9..ac20ba61b6 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,10 @@ +2013-02-13 Sergio Martin + + * include/graphs/functions_flot.php + include/graphs/flot/pandora.flot.js + operation/agentes/stat_win.php: Improve the legend of the + interactive graphs for bug 3573814 + 2013-02-13 Sergio Martin * include/styles/dialog.css diff --git a/pandora_console/include/graphs/flot/pandora.flot.js b/pandora_console/include/graphs/flot/pandora.flot.js index 08af9d3665..1fa313afad 100644 --- a/pandora_console/include/graphs/flot/pandora.flot.js +++ b/pandora_console/include/graphs/flot/pandora.flot.js @@ -788,7 +788,8 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, colors, var label_aux = series.label + ' = '; - if (serie_types[i] != 'points') { + // The graphs of points type and unknown graphs will dont be updated + if (serie_types[i] != 'points' && series.label != $('#hidden-unknown_text').val()) { legends.eq(i).text(label_aux.replace(/=.*/, '= ' + parseFloat(y).toFixed(2) +' '+unit)); } diff --git a/pandora_console/include/graphs/functions_flot.php b/pandora_console/include/graphs/functions_flot.php index 9f7f07004c..cc75936bd5 100644 --- a/pandora_console/include/graphs/functions_flot.php +++ b/pandora_console/include/graphs/functions_flot.php @@ -295,6 +295,9 @@ 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); // Javascript code $return .= "