Fixed visual of graphs in dashboardswhen used mobile version.

This commit is contained in:
m-lopez-f 2017-03-28 13:01:40 +02:00
parent 7dc9f9f21b
commit 881b86031c
2 changed files with 8 additions and 5 deletions

View File

@ -144,7 +144,7 @@ function pandoraFlotPieCustom(graph_id, values, labels, width,
var label_conf; var label_conf;
var show_legend = true; var show_legend = true;
if((width < 400) && (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent))) { if((width <= 450)) {
show_legend = false; show_legend = false;
label_conf = { label_conf = {
show: false show: false
@ -354,7 +354,7 @@ function pandoraFlotHBars(graph_id, values, labels, water_mark,
$('#' + graph_id).HUseTooltip(); $('#' + graph_id).HUseTooltip();
$('#' + graph_id).css("margin-left","auto"); $('#' + graph_id).css("margin-left","auto");
$('#' + graph_id).css("margin-right","auto"); $('#' + graph_id).css("margin-right","auto");
$('#' + graph_id).find('div.legend-tooltip').tooltip({ track: true }); //~ $('#' + graph_id).find('div.legend-tooltip').tooltip({ track: true });
function yFormatter(v, axis) { function yFormatter(v, axis) {
format = new Array(); format = new Array();
@ -731,7 +731,7 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
force_integer, separator, separator2, force_integer, separator, separator2,
yellow_up, red_up, yellow_inverse, red_inverse, yellow_up, red_up, yellow_inverse, red_inverse,
series_suffix_str, dashboard, vconsole, xaxisname,background_color,legend_color) { series_suffix_str, dashboard, vconsole, xaxisname,background_color,legend_color) {
var threshold = true; var threshold = true;
var thresholded = false; var thresholded = false;
font = font.split("/").pop().split(".").shift(); font = font.split("/").pop().split(".").shift();
@ -1928,6 +1928,7 @@ function set_watermark(graph_id, plot, watermark_src) {
if ($('#'+graph_id+' .yAxis .tickLabel').eq(0).css('height') != undefined) { if ($('#'+graph_id+' .yAxis .tickLabel').eq(0).css('height') != undefined) {
down_ticks_height = $('#'+graph_id+' .yAxis .tickLabel').eq(0).css('height').split('px')[0]; 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 left_pos = parseInt(context.canvas.width - 3) - $('#watermark_image_'+graph_id)[0].width;
var top_pos = 6; var top_pos = 6;
//var top_pos = parseInt(context.canvas.height - down_ticks_height - 10) - $('#watermark_image_'+graph_id)[0].height; //var top_pos = parseInt(context.canvas.height - down_ticks_height - 10) - $('#watermark_image_'+graph_id)[0].height;

View File

@ -54,6 +54,8 @@ function include_javascript_dependencies_flot_graph($return = false) {
ui_get_full_url($metaconsole_hack . '/include/graphs/flot/jquery.flot.exportdata.pandora.js') .'"></script> ui_get_full_url($metaconsole_hack . '/include/graphs/flot/jquery.flot.exportdata.pandora.js') .'"></script>
<script language="javascript" type="text/javascript" src="'. <script language="javascript" type="text/javascript" src="'.
ui_get_full_url($metaconsole_hack . '/include/graphs/flot/jquery.flot.axislabels.js') .'"></script> ui_get_full_url($metaconsole_hack . '/include/graphs/flot/jquery.flot.axislabels.js') .'"></script>
<script language="javascript" type="text/javascript" src="'.
ui_get_full_url($metaconsole_hack . '/include/graphs/flot/jquery.flot.image.js') .'"></script>
<script language="javascript" type="text/javascript" src="'. <script language="javascript" type="text/javascript" src="'.
ui_get_full_url($metaconsole_hack . '/include/graphs/flot/pandora.flot.js') .'"></script>'; ui_get_full_url($metaconsole_hack . '/include/graphs/flot/pandora.flot.js') .'"></script>';
$output .= " $output .= "
@ -205,7 +207,7 @@ function flot_area_graph($chart_data, $width, $height, $color, $legend,
// Parent layer // Parent layer
$return = "<div class='parent_graph' style='width: " . $width . "px; " . $background_style . "'>"; $return = "<div class='parent_graph' style='width: " . $width . "px; " . $background_style . "'>";
// Set some containers to legend, graph, timestamp tooltip, etc. // Set some containers to legend, graph, timestamp tooltip, etc.
$return .= "<p id='legend_$graph_id' class='legend_graph' style='font-size:".$font_size."pt'></p>"; $return .= "<p id='legend_$graph_id' class='legend_graph' style='font-size:$font_size"."pt !important;'></p>";
if (!empty($threshold_data)) { if (!empty($threshold_data)) {
$yellow_up = $threshold_data['yellow_up']; $yellow_up = $threshold_data['yellow_up'];
@ -241,7 +243,7 @@ function flot_area_graph($chart_data, $width, $height, $color, $legend,
$nbuttons++; $nbuttons++;
} }
$menu_width = 25 * $nbuttons + 15; $menu_width = 25 * $nbuttons + 15;
if ( $dashboard == false AND $vconsole == false) { if ( if ( $dashboard == false AND $vconsole == false) {) {
$return .= "<div id='menu_$graph_id' class='menu_graph' " . $return .= "<div id='menu_$graph_id' class='menu_graph' " .
"style='display: none; " . "style='display: none; " .
"text-align: center; " . "text-align: center; " .