new changes in graphs

This commit is contained in:
m-lopez-f 2017-03-17 13:30:11 +01:00
parent b8045691bd
commit 9e1b467850
3 changed files with 23 additions and 16 deletions

View File

@ -1556,7 +1556,6 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
alignTicksWithAxis: 1,
position: 'left',
font: font,
labelWidth: 50,
reserveSpace: true,
}],
legend: {
@ -1871,7 +1870,11 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
if (labels[v] == undefined) {
return '';
}
return '<div class='+font+' style="font-size:'+font_size+'pt; margin-top:15px; transform:rotate(-28deg)">'+labels[v]+'</div>';
extra_css = '';
if (!dashboard || !vconsole)
extra_css = " transform:rotate(-28deg); margin-left: -50px;";
return '<div class='+font+' style="font-size:'+font_size+'pt; margin-top:15px;'+extra_css+'">'+labels[v]+'</div>';
}
function yFormatter(v, axis) {
@ -2025,15 +2028,13 @@ function adjust_menu(graph_id, plot, parent_height, width) {
menu_height = $('#menu_'+graph_id).height();
}
offset = $('#' + graph_id).offsetTop;
$('#menu_' + graph_id)
.css('top',
((offset + 10) + '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', $('#'+graph_id)[0].offsetWidth);
//~ $('#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 + 100) . "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'></p>";
@ -242,13 +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: 25px; ".
"border-bottom: 0px; " .
"padding: 4px 4px 4px 4px;
margin-bottom:5px;'>
"text-align: center;" .
"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>";
@ -262,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);

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;">';