From 40ee2cce0a3f1db3d31f7f08301891b087eb4bc0 Mon Sep 17 00:00:00 2001 From: daniel Date: Mon, 20 Feb 2017 11:13:47 +0100 Subject: [PATCH] fixed errors in graphs --- .../images/logo_vertical_water.png | Bin 1866 -> 1110 bytes pandora_console/include/functions_graph.php | 8 ++++---- .../include/graphs/flot/pandora.flot.js | 14 +++++++------- .../include/graphs/functions_flot.php | 1 - 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/pandora_console/images/logo_vertical_water.png b/pandora_console/images/logo_vertical_water.png index 2238c38be72113c91e8a981eef89049fca5791cd..11b80755da6219e7226d48b6702782dc197e5e9c 100644 GIT binary patch delta 1088 zcmV-G1i$;r4%P@EiBL{Q4GJ0x0000DNk~Le000130000I2nGNE0jNSB%zqMyAESXo&eICkt<1CVY2(Lm`1KpX+Y9Hbb`01!Y7 zBs-&Nr(S~#?+lQ220;7)h#i3V0T90cVhJEt06B{!lK}#V5yk+T4)Q<+5U;3nzjT9A zCo>_j9iVgoHNpZQfM}0E0S&@be~mp5c=72*!>r?BAm##KOfo=Y4TgUJV{ZX8Q87Sc z_5@P!{eY?ii7|i@BF$V(GXM}kLk=-wOB~|7>J0um%?uZxZDct4a47>Yzkmt@1)y{S zG;TnAP+sDI6%Hr3$#HRqopoA#^b0~<$qJIHY zjsq(00TnlZ>gT{2!bqi&1rT2VhVF;Klq3KGXcP@ZrbEs+KY&T1W6(Mn=vYu94@k3I z1?%?Ch7e0UfU*maN)K42`U5FLJ%F_X zkeVm3(qjft`~|jB!XVdnJGg|n_-qq{1hB+F3T;>}w}4u<07+j0nwk?ZHBdgxaSx!y z7EC{~V|PGH5cJl;189-RfX%@lfFTMl%0NJXQyN7QS{8ReEk_0&e@JQ)prH(MKm?Ev z3fT+LSUCVK;!sK+Q2h)GL1X=|j70gkEMqx1U2gnS6V7~x^K}`}=QA{=gQGsA?xCTKk!Bil) zclloOrD-5D%OJh%f6`s=uJ7)9@80|Fb-zu=jUUWf97LkT8{Vee`t!K$05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oR&hOz>4>+!?#$5Q<))FGZDa;M!AZ69khSa%0ksAMhj1g zH;XYAxln`Je>IqJIwdd?0q{3+O=z;APG-xQ6FT6>VmCbx;TRpeNc{QmJbn1M2tU6D zv|8OQ1mU{n{Bg(kL#`A>hKfqb6-1$S(NqA!=VBo!ro&&<%cq5#M#^Vw$5O1{)bpH& zFoM5WiNgD8fqGM2pnP|%EY_%R?+w^YF3|swT02&Ve=e2P%Gl?a8|+(vcC8S$jUWg< zC@6{gtj`)LpoY(Clm;3GMk+B(Sz(}|RTNklP!Q-Ay-FGtJxtjZRC?0tTJ%zgrIOx$ zW}ETm|NNo#of5^d*XO(4xw+k0r=K()#-R}!DUe^4118rfW7_1}9RWuG#qkgzG$WC* z{&UkMfAI>G0FqU5@qY}C0E{$YO{e-&z)37*fl`J2b15sZ;5D5Sc5x_8SG zQtsO-SHPiC0A9;wjtGNr(I*Z&MNySYgVhEXb}@oR ze{XMlOIyLAz<3#$;_%>Bs`>W&^S$1a4$+2GC?nwHk@*X%;0v;C;RFq;C#S?pCshq3 zcvoYn6AYkY+$5t8J_%`RTeBRpg$w{0v0`H#yAPn?c^9Zc7VTKWU20&*3 zVM(X6!um3k+q7mcJ`xsdbD^NstC#%i4RcKJ%ZJeo^=igeD?>?PY}5f5Rm%ByN9Rxq oDhIN2mvoLa(nuqXT^@e{&PtA85QC5`?*IS*07*qoM6N<$f)}Ph>Hq)$ diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 41dbf2d362..93a62c1c05 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -755,12 +755,12 @@ function grafico_modulo_sparse_data ($agent_module_id, $period, $show_events, . __('Avg') . ': ' . remove_right_zeros(number_format($graph_stats['sum']['avg'], $config['graph_precision'])) . ($unit ? ' ' . $unit : ''); } else if (!$avg_only) { - $legend['max'.$series_suffix] = __('Max').$series_suffix_str.': '.__('Last').': '.remove_right_zeros(number_format($graph_stats['max']['last'], $config['graph_precision'])).' '.$unit.' ; '.__('Avg').': '.remove_right_zeros(number_format($graph_stats['max']['avg'], $config['graph_precision'])).' '.$unit.' ; '.__('Max').': '.remove_right_zeros(number_format($graph_stats['max']['max'], $config['graph_precision'])).' '.$unit.' ; '.__('Min').': '.remove_right_zeros(number_format($graph_stats['max']['min'], $config['graph_precision'])).' '.$unit; - $legend['sum'.$series_suffix] = __('Avg').$series_suffix_str.': '.__('Last').': '.remove_right_zeros(number_format($graph_stats['sum']['last'], $config['graph_precision'])).' '.$unit.' ; '.__('Avg').': '.remove_right_zeros(number_format($graph_stats['sum']['avg'], $config['graph_precision'])).' '.$unit.' ; '.__('Max').': '.remove_right_zeros(number_format($graph_stats['sum']['max'], $config['graph_precision'])).' '.$unit.' ; '.__('Min').': '.remove_right_zeros(number_format($graph_stats['sum']['min'], $config['graph_precision'])).' '.$unit; - $legend['min'.$series_suffix] = __('Min').$series_suffix_str.': '.__('Last').': '.remove_right_zeros(number_format($graph_stats['min']['last'], $config['graph_precision'])).' '.$unit.' ; '.__('Avg').': '.remove_right_zeros(number_format($graph_stats['min']['avg'], $config['graph_precision'])).' '.$unit.' ; '.__('Max').': '.remove_right_zeros(number_format($graph_stats['min']['max'], $config['graph_precision'])).' '.$unit.' ; '.__('Min').': '.remove_right_zeros(number_format($graph_stats['min']['min'], $config['graph_precision'])).' '.$unit; + $legend['max'.$series_suffix] = __('Max').$series_suffix_str.': '.__('Avg').': '.remove_right_zeros(number_format($graph_stats['max']['avg'], $config['graph_precision'])).' '.$unit.' ; '.__('Max').': '.remove_right_zeros(number_format($graph_stats['max']['max'], $config['graph_precision'])).' '.$unit.' ; '.__('Min').': '.remove_right_zeros(number_format($graph_stats['max']['min'], $config['graph_precision'])).' '.$unit; + $legend['sum'.$series_suffix] = __('Avg').$series_suffix_str.': '.__('Avg').': '.remove_right_zeros(number_format($graph_stats['sum']['avg'], $config['graph_precision'])).' '.$unit.' ; '.__('Max').': '.remove_right_zeros(number_format($graph_stats['sum']['max'], $config['graph_precision'])).' '.$unit.' ; '.__('Min').': '.remove_right_zeros(number_format($graph_stats['sum']['min'], $config['graph_precision'])).' '.$unit; + $legend['min'.$series_suffix] = __('Min').$series_suffix_str.': '.__('Avg').': '.remove_right_zeros(number_format($graph_stats['min']['avg'], $config['graph_precision'])).' '.$unit.' ; '.__('Max').': '.remove_right_zeros(number_format($graph_stats['min']['max'], $config['graph_precision'])).' '.$unit.' ; '.__('Min').': '.remove_right_zeros(number_format($graph_stats['min']['min'], $config['graph_precision'])).' '.$unit; } else { - $legend['sum'.$series_suffix] = __('Avg').$series_suffix_str.': '.__('Last').': '.remove_right_zeros(number_format($graph_stats['sum']['last'], $config['graph_precision'])).' '.$unit.' ; '.__('Avg').': '.remove_right_zeros(number_format($graph_stats['sum']['avg'], $config['graph_precision'])).' '.$unit.' ; '.__('Max').': '.remove_right_zeros(number_format($graph_stats['sum']['max'], $config['graph_precision'])).' '.$unit.' ; '.__('Min').': '.remove_right_zeros(number_format($graph_stats['sum']['min'], $config['graph_precision'])).' '.$unit; + $legend['sum'.$series_suffix] = __('Avg').$series_suffix_str.': '.__('Avg').': '.remove_right_zeros(number_format($graph_stats['sum']['avg'], $config['graph_precision'])).' '.$unit.' ; '.__('Max').': '.remove_right_zeros(number_format($graph_stats['sum']['max'], $config['graph_precision'])).' '.$unit.' ; '.__('Min').': '.remove_right_zeros(number_format($graph_stats['sum']['min'], $config['graph_precision'])).' '.$unit; } //Baseline was replaced by compare graph feature /*if ($baseline) { diff --git a/pandora_console/include/graphs/flot/pandora.flot.js b/pandora_console/include/graphs/flot/pandora.flot.js index 4c7a47e136..05f55b99e0 100644 --- a/pandora_console/include/graphs/flot/pandora.flot.js +++ b/pandora_console/include/graphs/flot/pandora.flot.js @@ -1537,7 +1537,7 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, hoverable: true, clickable: true, borderWidth:1, - borderColor: '#666', + borderColor: '#C1C1C1', tickColor: background_color, markings: markings, color: legend_color @@ -2198,10 +2198,10 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, set_watermark(graph_id, plot, $('#watermark_image_'+graph_id).attr('src')); } - adjust_menu(graph_id, plot, parent_height); + adjust_menu(graph_id, plot, parent_height, width); } -function adjust_menu(graph_id, plot, parent_height) { +function adjust_menu(graph_id, plot, parent_height, width) { if ($('#'+graph_id+' .xAxis .tickLabel').eq(0).css('width') != undefined) { left_ticks_width = $('#'+graph_id+' .xAxis .tickLabel').eq(0).css('width').split('px')[0]; } @@ -2234,7 +2234,7 @@ function adjust_menu(graph_id, plot, parent_height) { //$('#legend_' + graph_id).css('width',plot.width()); $('#menu_' + graph_id) - .css('left',plot.width() - $('#menu_'+graph_id).width() + 10); + .css('left',width - $('#menu_'+graph_id).width()); $('#menu_' + graph_id).show(); } @@ -2251,10 +2251,10 @@ function set_watermark(graph_id, plot, watermark_src) { if ($('#'+graph_id+' .yAxis .tickLabel').eq(0).css('height') != undefined) { down_ticks_height = $('#'+graph_id+' .yAxis .tickLabel').eq(0).css('height').split('px')[0]; } - //var left_pos = parseInt(context.canvas.width - 3) - $('#watermark_image_'+graph_id)[0].width; - //var top_pos = parseInt(context.canvas.height - down_ticks_height - 10) - $('#watermark_image_'+graph_id)[0].height; - var left_pos = 380; + var left_pos = parseInt(context.canvas.width - 3) - $('#watermark_image_'+graph_id)[0].width; var top_pos = 6; + //var top_pos = parseInt(context.canvas.height - down_ticks_height - 10) - $('#watermark_image_'+graph_id)[0].height; + //var left_pos = 380; context.drawImage(this, left_pos, top_pos); }, false); diff --git a/pandora_console/include/graphs/functions_flot.php b/pandora_console/include/graphs/functions_flot.php index 952ac1717b..87f8e5fb42 100644 --- a/pandora_console/include/graphs/functions_flot.php +++ b/pandora_console/include/graphs/functions_flot.php @@ -246,7 +246,6 @@ function flot_area_graph($chart_data, $width, $height, $color, $legend, "style='display: none; " . "text-align: center; " . "width: " . $menu_width . "px; ". - "border: solid 1px #666; ". "border-bottom: 0px; " . "padding: 4px 4px 4px 4px;margin-bottom:5px;'> ".__(";