From cd81e77b18dac99f8f449bccd6e4a5f7214cf2f4 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Tue, 15 Sep 2020 11:13:41 +0200 Subject: [PATCH] fix event legend --- .../include/graphs/flot/pandora.flot.js | 10 ++++---- .../include/graphs/functions_flot.php | 24 +++++++++---------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/pandora_console/include/graphs/flot/pandora.flot.js b/pandora_console/include/graphs/flot/pandora.flot.js index 3f4d4d17fe..1a100ba5c6 100644 --- a/pandora_console/include/graphs/flot/pandora.flot.js +++ b/pandora_console/include/graphs/flot/pandora.flot.js @@ -1918,8 +1918,7 @@ function pandoraFlotArea( case "points": line_show = false; points_show = true; - filled = false; - steps_chart = false; + filled = true; radius = 3; fill_points = fill_color; break; @@ -1959,7 +1958,8 @@ function pandoraFlotArea( points: { show: points_show, radius: radius, - fillColor: fill_points + fillColor: fill_points, + fill: filled }, legend: legend.index }); @@ -2521,7 +2521,7 @@ function pandoraFlotArea( plot.unhighlight(); $("#extra_" + graph_id).css("width", "170px"); - $("#extra_" + graph_id).css("height", "60px"); + $("#extra_" + graph_id).css("height", "auto"); var extra_info = "No info to show"; var extra_show = false; @@ -2537,7 +2537,7 @@ function pandoraFlotArea( var width_graph = plot.width(); var height_legend = $("#legend_" + graph_id).height(); var coord_x = pos.pageX - offset_relative.left + offset_graph.left; - var coord_y = offset_graph.top + height_legend + extra_height; + var coord_y = offset_graph.top + height_legend + extra_height + 50; if (coord_x + extra_width > width_graph) { coord_x = coord_x - extra_width; diff --git a/pandora_console/include/graphs/functions_flot.php b/pandora_console/include/graphs/functions_flot.php index da501a6546..6499cc876c 100644 --- a/pandora_console/include/graphs/functions_flot.php +++ b/pandora_console/include/graphs/functions_flot.php @@ -279,20 +279,18 @@ function flot_area_graph( $series_type_unique['data_'.$graph_id.'_'.$k] = $v; } - /* - // Store data series in javascript format. - $extra_width = (int) ($params['width'] / 3); - $return .= "
"; + // Store data series in javascript format. + $extra_width = (int) ($params['width'] / 3); + $return .= "
"; - // Trick to get translated string from javascript. - $return .= html_print_input_hidden('unknown_text', __('Unknown'), true); - */ + // Trick to get translated string from javascript. + $return .= html_print_input_hidden('unknown_text', __('Unknown'), true); $values = json_encode($array_data);