Merge branch 'fixed-graphs-styles' into 'develop'

Fixed graphs styles Gitlab: #537

See merge request !283
This commit is contained in:
vgilc 2017-05-17 17:45:55 +02:00
commit e89be76e61
3 changed files with 43 additions and 41 deletions

View File

@ -1420,22 +1420,18 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
axisLabelUseCanvas: false,
axisLabel: xaxisname,
tickFormatter: xFormatter,
//~ minTickSize: steps,
labelHeight: 50,
color: '',
font: font
}],
yaxes: [{
tickFormatter: yFormatter,
color: ''
},
{
// align if we are to the right
color: '',
alignTicksWithAxis: 1,
position: 'right',
font: font
//tickFormatter: dFormatter
} ]
,
position: 'left',
font: font,
reserveSpace: true,
}],
legend: {
position: 'se',
container: $('#legend_' + graph_id),
@ -1761,18 +1757,19 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
if (labels[v] == undefined) {
return '';
}
return '<div class='+font+' style="font-size:'+font_size+'pt !important;">'+labels[v]+'</div>';
extra_css = '';
return '<div class='+font+' style="font-size:'+font_size+'pt; margin-top:15px;'+extra_css+'">'+labels[v]+'</div>';
}
function yFormatter(v, axis) {
axis.datamin = 0;
var formatted = number_format(v,force_integer,unit);
return '<div class='+font+' style="font-size:'+font_size+'pt !important;">'+formatted+'</div>';
return '<div class='+font+' style="font-size:'+font_size+'pt;">'+formatted+'</div>';
}
function lFormatter(v, item) {
return '<div style="font-size:'+font_size+'pt !important;">'+v+'</div>';
return '<div style="font-size:'+font_size+'pt;">'+v+'</div>';
// Prepared to turn series with a checkbox
//return '<div style=color:;font-size:'+font_size+'pt><input type="checkbox" id="' + graph_id + '_' + item.id +'" checked="checked" class="check_serie_'+graph_id+'">'+v+'</div>';
}
@ -1919,16 +1916,14 @@ function adjust_menu(graph_id, plot, parent_height, width) {
menu_height = $('#menu_'+graph_id).height();
}
offset_between_graph_and_div_graph_container = $('#' + graph_id).offset().top -
$('#' + graph_id).parent().offset().top;
$('#menu_' + graph_id)
.css('top',
((offset_between_graph_and_div_graph_container - menu_height - 5) + 'px'));
offset = $('#' + graph_id)[0].offsetTop;
console.log(offset);
$('#menu_' + graph_id).css('top', ((offset) + 'px'));
//$('#legend_' + graph_id).css('width',plot.width());
$('#menu_' + graph_id)
.css('left',width - $('#menu_'+graph_id).width());
//~ $('#menu_' + graph_id).css('left', $('#'+graph_id)[0].offsetWidth);
$('#menu_' + graph_id).show();
}

View File

@ -203,7 +203,7 @@ function flot_area_graph($chart_data, $width, $height, $color, $legend,
}
// 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.
$return .= "<p id='legend_$graph_id' class='legend_graph' style='font-size:$font_size"."pt !important;'></p>";
@ -242,12 +242,18 @@ function flot_area_graph($chart_data, $width, $height, $color, $legend,
}
$menu_width = 25 * $nbuttons + 15;
if ( $dashboard == false AND $vconsole == false) {
$return .= "<div id='menu_$graph_id' class='menu_graph' " .
$return .= "<div id='geneal_menu_$graph_id' class='menu_graph' style='
width: 30px;
height: 250px;
left: " . $width . "px;
position: absolute;
top: 0px;
background-color: white;'>";
$return .= "<div id='menu_$graph_id' " .
"style='display: none; " .
"text-align: center;" .
"width: " . $menu_width . "px; ".
"border-bottom: 0px; " .
"padding: 4px 4px 4px 4px;margin-bottom:5px;'>
"position: relative;".
"border-bottom: 0px;'>
<a href='javascript:'><img id='menu_cancelzoom_$graph_id' src='".$homeurl."images/zoom_cross_grey.disabled.png' alt='".__('Cancel zoom')."' title='".__('Cancel zoom')."'></a>";
if ($threshold) {
$return .= " <a href='javascript:'><img id='menu_threshold_$graph_id' src='".$homeurl."images/chart_curve_threshold.png' alt='".__('Warning and Critical thresholds')."' title='".__('Warning and Critical thresholds')."'></a>";
@ -261,6 +267,7 @@ function flot_area_graph($chart_data, $width, $height, $color, $legend,
//$return .= " <a href='javascript:'><img id='menu_export_json_$graph_id' src='".$homeurl."images/json.png' alt='".__('Export to JSON')."' title='".__('Export to JSON')."'></a>";
$return .= "</div>";
$return .= "</div>";
}
}
$return .= html_print_input_hidden('line_width_graph', $config['custom_graph_width'], true);
@ -275,7 +282,7 @@ function flot_area_graph($chart_data, $width, $height, $color, $legend,
$height = 1;
}
if (!$dashboard && !$vconsole)
$return .= "<div id='overview_$graph_id' class='overview_graph' style='display: none; margin-left:0px; margin-top:20px; width: ".$width."px; height: ".$height ."px;'></div>";
$return .= "<div id='overview_$graph_id' class='overview_graph' style='display: none; margin-left:0px; margin-top:20px; margin-bottom:50px; width: ".$width."px; height: ".$height ."px;'></div>";
if ($water_mark != '') {
$return .= "<div id='watermark_$graph_id' style='display:none; position:absolute;'><img id='watermark_image_$graph_id' src='$water_mark'></div>";

View File

@ -201,7 +201,7 @@ $alias = db_get_value ("alias","tagente","id_agente",$id_agent);
// log4x doesnt support flash yet
//
if ($config['flash_charts'] == 1)
echo '<div style="margin-left: 70px; padding-top: 10px;">';
echo '<div style="margin-left: 100px; padding-top: 10px;">';
else
echo '<div style="margin-left: 50px; padding-top: 10px;">';