fix event legend

This commit is contained in:
fbsanchez 2020-09-15 11:13:41 +02:00
parent d4b081bef7
commit cd81e77b18
2 changed files with 16 additions and 18 deletions

View File

@ -1918,8 +1918,7 @@ function pandoraFlotArea(
case "points": case "points":
line_show = false; line_show = false;
points_show = true; points_show = true;
filled = false; filled = true;
steps_chart = false;
radius = 3; radius = 3;
fill_points = fill_color; fill_points = fill_color;
break; break;
@ -1959,7 +1958,8 @@ function pandoraFlotArea(
points: { points: {
show: points_show, show: points_show,
radius: radius, radius: radius,
fillColor: fill_points fillColor: fill_points,
fill: filled
}, },
legend: legend.index legend: legend.index
}); });
@ -2521,7 +2521,7 @@ function pandoraFlotArea(
plot.unhighlight(); plot.unhighlight();
$("#extra_" + graph_id).css("width", "170px"); $("#extra_" + graph_id).css("width", "170px");
$("#extra_" + graph_id).css("height", "60px"); $("#extra_" + graph_id).css("height", "auto");
var extra_info = "<i>No info to show</i>"; var extra_info = "<i>No info to show</i>";
var extra_show = false; var extra_show = false;
@ -2537,7 +2537,7 @@ function pandoraFlotArea(
var width_graph = plot.width(); var width_graph = plot.width();
var height_legend = $("#legend_" + graph_id).height(); var height_legend = $("#legend_" + graph_id).height();
var coord_x = pos.pageX - offset_relative.left + offset_graph.left; 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) { if (coord_x + extra_width > width_graph) {
coord_x = coord_x - extra_width; coord_x = coord_x - extra_width;

View File

@ -279,20 +279,18 @@ function flot_area_graph(
$series_type_unique['data_'.$graph_id.'_'.$k] = $v; $series_type_unique['data_'.$graph_id.'_'.$k] = $v;
} }
/* // Store data series in javascript format.
// Store data series in javascript format. $extra_width = (int) ($params['width'] / 3);
$extra_width = (int) ($params['width'] / 3); $return .= "<div id='extra_$graph_id'
$return .= "<div id='extra_$graph_id' style='font-size: ".$params['font_size'].'pt;
style='font-size: ".$params['font_size'].'pt; display:none; position:absolute; overflow: auto;
display:none; position:absolute; overflow: auto; max-height: '.($params['height'] + 50).'px;
max-height: '.($params['height'] + 50).'px; width: '.$extra_width."px;
width: '.$extra_width."px; background:#fff; padding: 2px 2px 2px 2px;
background:#fff; padding: 2px 2px 2px 2px; border: solid #000 1px;'></div>";
border: solid #000 1px;'></div>";
// Trick to get translated string from javascript. // 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);
*/
$values = json_encode($array_data); $values = json_encode($array_data);