From 735a00a99fcaf7f0396161a357fe3296689e1535 Mon Sep 17 00:00:00 2001 From: zarzuelo Date: Thu, 12 Dec 2013 14:49:36 +0000 Subject: [PATCH] 2013-12-12 Sergio Martin * include/graphs/functions_flot.php include/graphs/flot/pandora.flot.js include/javascript/pandora.js include/styles/pandora.css operation/agentes/stat_win.php: A lot of fixes on the javascript graphs to be shown correctly in IE. Tested and working fine on IE9 with compatibility mode on. Incident: #417 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9216 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 11 +++++++ .../include/graphs/flot/pandora.flot.js | 17 +++++++--- .../include/graphs/functions_flot.php | 14 ++++---- pandora_console/include/javascript/pandora.js | 2 +- pandora_console/include/styles/pandora.css | 33 +++++++++++++++++++ .../operation/agentes/stat_win.php | 4 +-- 6 files changed, 66 insertions(+), 15 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 7378129fc1..28720d963d 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,14 @@ +2013-12-12 Sergio Martin + + * include/graphs/functions_flot.php + include/graphs/flot/pandora.flot.js + include/javascript/pandora.js + include/styles/pandora.css + operation/agentes/stat_win.php: A lot of fixes on the + javascript graphs to be shown correctly in IE. Tested + and working fine on IE9 with compatibility mode on. + Incident: #417 + 2013-12-11 Sergio Martin * include/graphs/flot/pandora.flot.js: Add one decimal diff --git a/pandora_console/include/graphs/flot/pandora.flot.js b/pandora_console/include/graphs/flot/pandora.flot.js index f4608a9969..49507218ae 100644 --- a/pandora_console/include/graphs/flot/pandora.flot.js +++ b/pandora_console/include/graphs/flot/pandora.flot.js @@ -812,9 +812,9 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, colors, dataset = plot.getData(); } - var timenewpos = dataset[0].xaxis.p2c(pos.x)+plot.offset().left; + var timenewpos = dataset[0].xaxis.p2c(pos.x)+$('.yAxis>div').eq(0).width(); - var canvaslimit = plot.offset().left + plot.width(); + var canvaslimit = plot.width(); if (timesize+timenewpos > canvaslimit) { $('#timestamp_'+graph_id).css('left', timenewpos - timesize); @@ -966,7 +966,7 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, colors, var parent_height; $('#menu_overview_'+graph_id).click(function() { $('#overview_'+graph_id).toggle(); - adjust_menu(graph_id, plot, parent_height); + //adjust_menu(graph_id, plot, parent_height); }); $('#menu_threshold_'+graph_id).click(function() { @@ -1024,6 +1024,8 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, colors, if (water_mark) { set_watermark(graph_id, plot, $('#watermark_image_'+graph_id).attr('src')); } + + adjust_menu(graph_id, plot, parent_height); } function adjust_menu(graph_id, plot, parent_height) { @@ -1044,9 +1046,14 @@ function adjust_menu(graph_id, plot, parent_height) { overview_height = parseInt($('#overview_'+graph_id).css('height').split('px')[0]) + parseInt($('#overview_'+graph_id).css('margin-top').split('px')[0]); } - $('#menu_'+graph_id).css('top', - (-parent_height+legend_height-overview_height-7)+'px'); + var menu_height = '25'; + + if($('#menu_'+graph_id).height() != undefined || $('#menu_'+graph_id).height() < 20) { + menu_height = $('#menu_'+graph_id).height(); + } + $('#menu_'+graph_id).css('top', (($('#'+graph_id).offset().top-menu_height-15)+'px')); + $('#legend_'+graph_id).css('width',plot.width()); $('#menu_'+graph_id).css('left',plot.width()-$('#menu_'+graph_id).width() + 10); $('#menu_'+graph_id).show(); } diff --git a/pandora_console/include/graphs/functions_flot.php b/pandora_console/include/graphs/functions_flot.php index 1966b0ec78..e7aac076aa 100644 --- a/pandora_console/include/graphs/functions_flot.php +++ b/pandora_console/include/graphs/functions_flot.php @@ -126,12 +126,12 @@ function flot_area_graph($chart_data, $width, $height, $color, $legend, $long_in $graph_id = uniqid('graph_'); // Parent layer - $return = "
"; + $return = "
"; // Set some containers to legend, graph, timestamp tooltip, etc. - $return .= "

"; - $return .= ""; + $return .= "

"; + $return .= ""; $return .= "
"; - $return .= ""; + $return .= ""; if ($water_mark != '') { $return .= ""; @@ -226,8 +226,8 @@ function flot_area_graph($chart_data, $width, $height, $color, $legend, $long_in $nbuttons++; } - $menu_width = 25 * $nbuttons + 8; - $return .= "