From 31605a14a2547e640158cc4fb0e9ab0e687bb173 Mon Sep 17 00:00:00 2001 From: m-lopez-f Date: Mon, 21 Nov 2016 13:27:34 +0100 Subject: [PATCH] Fixed problems with fonts in simples graphs. Ticket: #4115 (cherry picked from commit c5e0b84ad316edf04fc050b17023979f4a3805a6) --- .../include/graphs/flot/pandora.flot.js | 9 ++-- .../include/graphs/functions_flot.php | 49 +++++++++++-------- 2 files changed, 33 insertions(+), 25 deletions(-) diff --git a/pandora_console/include/graphs/flot/pandora.flot.js b/pandora_console/include/graphs/flot/pandora.flot.js index 1993c6f5a7..70c3d4a711 100644 --- a/pandora_console/include/graphs/flot/pandora.flot.js +++ b/pandora_console/include/graphs/flot/pandora.flot.js @@ -1541,7 +1541,8 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, axisLabel: xaxisname, tickFormatter: xFormatter, minTickSize: steps, - color: '#000' + color: '#000', + font: font } ], yaxes: [ { tickFormatter: yFormatter, @@ -1550,8 +1551,8 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, { // align if we are to the right alignTicksWithAxis: 1, - position: 'right' - + position: 'right', + font: font //tickFormatter: dFormatter } ] , @@ -1879,7 +1880,7 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, } function lFormatter(v, item) { - return '
'+v+'
'; + return '
'+v+'
'; // Prepared to turn series with a checkbox //return '
'+v+'
'; } diff --git a/pandora_console/include/graphs/functions_flot.php b/pandora_console/include/graphs/functions_flot.php index d8e0c2dc22..2bf220bede 100644 --- a/pandora_console/include/graphs/functions_flot.php +++ b/pandora_console/include/graphs/functions_flot.php @@ -95,11 +95,12 @@ function include_javascript_dependencies_flot_graph($return = false) { ////////// AREA GRAPHS //////// /////////////////////////////// function flot_area_stacked_graph($chart_data, $width, $height, $color, - $legend, $long_index, $homeurl = '', $font = '', $font_size = 7,$unit = '', $water_mark = '', - $serie_types = array(), $chart_extra_data = array(), - $yellow_threshold = 0, $red_threshold = 0, $adapt_key= '', - $force_integer = false, $series_suffix_str = '', $menu = true, - $background_color = 'white', $dashboard = false, $vconsole = false, $agent_module_id = 0) { + $legend, $long_index, $homeurl = '', $font = '', $font_size = 7, + $unit = '', $water_mark = '', $serie_types = array(), + $chart_extra_data = array(), $yellow_threshold = 0, + $red_threshold = 0, $adapt_key= '', $force_integer = false, + $series_suffix_str = '', $menu = true, $background_color = 'white', + $dashboard = false, $vconsole = false, $agent_module_id = 0) { global $config; @@ -107,7 +108,8 @@ function flot_area_stacked_graph($chart_data, $width, $height, $color, $legend, $long_index, $homeurl, $unit, 'area_stacked', $water_mark, $serie_types, $chart_extra_data, $yellow_threshold, $red_threshold, $adapt_key, $force_integer, $series_suffix_str, - $menu, $background_color, $dashboard, $vconsole, $agent_module_id, $font,$font_size); + $menu, $background_color, $dashboard, $vconsole, + $agent_module_id, $font, $font_size); } function flot_area_simple_graph($chart_data, $width, $height, $color, @@ -115,7 +117,8 @@ function flot_area_simple_graph($chart_data, $width, $height, $color, $serie_types = array(), $chart_extra_data = array(), $yellow_threshold = 0, $red_threshold = 0, $adapt_key= '', $force_integer = false, $series_suffix_str = '', $menu = true, - $background_color = 'white', $dashboard = false, $vconsole = false, $agent_module_id = 0, $font = '',$font_size = 7, $xaxisname = '') { + $background_color = 'white', $dashboard = false, $vconsole = false, + $agent_module_id = 0, $font = '', $font_size = 7, $xaxisname = '') { global $config; @@ -123,15 +126,17 @@ function flot_area_simple_graph($chart_data, $width, $height, $color, $legend, $long_index, $homeurl, $unit, 'area_simple', $water_mark, $serie_types, $chart_extra_data, $yellow_threshold, $red_threshold, $adapt_key, $force_integer, $series_suffix_str, - $menu, $background_color, $dashboard, $vconsole, $agent_module_id,$font,$font_size, $xaxisname); + $menu, $background_color, $dashboard, $vconsole, + $agent_module_id, $font, $font_size, $xaxisname); } function flot_line_stacked_graph($chart_data, $width, $height, $color, - $legend, $long_index, $homeurl = '',$font = '', $font_size = 7, $unit = '', $water_mark = '', - $serie_types = array(), $chart_extra_data = array(), - $yellow_threshold = 0, $red_threshold = 0, $adapt_key= '', - $force_integer = false, $series_suffix_str = '', $menu = true, - $background_color = 'white', $dashboard = false, $vconsole = false, $agent_module_id = 0) { + $legend, $long_index, $homeurl = '', $font = '', $font_size = 7, + $unit = '', $water_mark = '', $serie_types = array(), + $chart_extra_data = array(), $yellow_threshold = 0, + $red_threshold = 0, $adapt_key= '', $force_integer = false, + $series_suffix_str = '', $menu = true, $background_color = 'white', + $dashboard = false, $vconsole = false, $agent_module_id = 0) { global $config; @@ -139,16 +144,18 @@ function flot_line_stacked_graph($chart_data, $width, $height, $color, $legend, $long_index, $homeurl, $unit, 'line_stacked', $water_mark, $serie_types, $chart_extra_data, $yellow_threshold, $red_threshold, $adapt_key, $force_integer, $series_suffix_str, - $menu, $background_color, $dashboard, $vconsole, $agent_module_id, $font, $font_size); + $menu, $background_color, $dashboard, $vconsole, + $agent_module_id, $font, $font_size); } function flot_line_simple_graph($chart_data, $width, $height, $color, - $legend, $long_index, $homeurl = '', $font = '', $font_size = 7, $unit = '', $water_mark = '', - $serie_types = array(), $chart_extra_data = array(), - $yellow_threshold = 0, $red_threshold = 0, $adapt_key= '', - $force_integer = false, $series_suffix_str = '', $menu = true, - $background_color = 'white', $dashboard = false, $vconsole = false, - $agent_module_id = 0, $percentil_values = array()) { + $legend, $long_index, $homeurl = '', $font = '', $font_size = 7, + $unit = '', $water_mark = '', $serie_types = array(), + $chart_extra_data = array(), $yellow_threshold = 0, + $red_threshold = 0, $adapt_key= '', $force_integer = false, + $series_suffix_str = '', $menu = true, $background_color = 'white', + $dashboard = false, $vconsole = false, $agent_module_id = 0, + $percentil_values = array()) { global $config; @@ -165,7 +172,7 @@ function flot_area_graph($chart_data, $width, $height, $color, $legend, $chart_extra_data, $yellow_threshold, $red_threshold, $adapt_key, $force_integer, $series_suffix_str = '', $menu = true, $background_color = 'white', $dashboard = false, $vconsole = false, - $agent_module_id = 0,$font = '',$font_size = 7, $xaxisname = '', + $agent_module_id = 0, $font = '', $font_size = 7, $xaxisname = '', $percentil_values = array()) { global $config;