Apply the fix of the area graph height only to the dashboard and the visual consoles

This commit is contained in:
Alejandro Gallardo Escobar 2016-05-30 17:55:07 +02:00
parent 2aa420e623
commit a2ba4acb6c
2 changed files with 7 additions and 4 deletions

View File

@ -805,7 +805,7 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
alert_ids, legend_alerts, yellow_threshold, red_threshold,
force_integer, separator, separator2,
yellow_up, red_up, yellow_inverse, red_inverse,
series_suffix_str, vconsole) {
series_suffix_str, dashboard, vconsole) {
var threshold = true;
var thresholded = false;
@ -1525,8 +1525,10 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
var plot = $.plot($('#' + graph_id), datas, options);
// Re-calculate the graph height with the legend height
$('#'+graph_id).css('height',
$('#'+graph_id).height() - $('#legend_'+graph_id).height());
if (dashboard || vconsole) {
var hDiff = $('#'+graph_id).height() - $('#legend_'+graph_id).height();
$('#'+graph_id).css('height', hDiff);
}
if (vconsole) {
var myCanvas = plot.getCanvas();

View File

@ -447,7 +447,8 @@ function flot_area_graph($chart_data, $width, $height, $color, $legend,
"'$yellow_inverse', \n" .
"'$red_inverse', \n" .
"'$series_suffix_str',
'$vconsole');";
" . json_encode($dashboard) . ",\n
" . json_encode($vconsole) . ");";
$return .= "\n//]]>";
$return .= "</script>";