Merge branch 'fixed-graphs-styles' into 'develop'
Fixed graphs styles Gitlab: #537 See merge request !283
This commit is contained in:
commit
e89be76e61
|
@ -1414,33 +1414,29 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
|
||||||
tickColor: background_color,
|
tickColor: background_color,
|
||||||
markings: markings,
|
markings: markings,
|
||||||
color: legend_color
|
color: legend_color
|
||||||
},
|
},
|
||||||
xaxes: [ {
|
xaxes: [{
|
||||||
axisLabelFontSizePixels: font_size,
|
axisLabelFontSizePixels: font_size,
|
||||||
axisLabelUseCanvas: false,
|
axisLabelUseCanvas: false,
|
||||||
axisLabel: xaxisname,
|
axisLabel: xaxisname,
|
||||||
tickFormatter: xFormatter,
|
tickFormatter: xFormatter,
|
||||||
//~ minTickSize: steps,
|
labelHeight: 50,
|
||||||
color: '',
|
color: '',
|
||||||
font: font
|
font: font
|
||||||
} ],
|
}],
|
||||||
yaxes: [ {
|
yaxes: [{
|
||||||
tickFormatter: yFormatter,
|
tickFormatter: yFormatter,
|
||||||
color: ''
|
color: '',
|
||||||
},
|
alignTicksWithAxis: 1,
|
||||||
{
|
position: 'left',
|
||||||
// align if we are to the right
|
font: font,
|
||||||
alignTicksWithAxis: 1,
|
reserveSpace: true,
|
||||||
position: 'right',
|
}],
|
||||||
font: font
|
|
||||||
//tickFormatter: dFormatter
|
|
||||||
} ]
|
|
||||||
,
|
|
||||||
legend: {
|
legend: {
|
||||||
position: 'se',
|
position: 'se',
|
||||||
container: $('#legend_' + graph_id),
|
container: $('#legend_' + graph_id),
|
||||||
labelFormatter: lFormatter
|
labelFormatter: lFormatter
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
if (vconsole) {
|
if (vconsole) {
|
||||||
options.grid['hoverable'] = false;
|
options.grid['hoverable'] = false;
|
||||||
|
@ -1761,18 +1757,19 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
|
||||||
if (labels[v] == undefined) {
|
if (labels[v] == undefined) {
|
||||||
return '';
|
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) {
|
function yFormatter(v, axis) {
|
||||||
axis.datamin = 0;
|
axis.datamin = 0;
|
||||||
var formatted = number_format(v,force_integer,unit);
|
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) {
|
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
|
// 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>';
|
//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();
|
menu_height = $('#menu_'+graph_id).height();
|
||||||
}
|
}
|
||||||
|
|
||||||
offset_between_graph_and_div_graph_container = $('#' + graph_id).offset().top -
|
offset = $('#' + graph_id)[0].offsetTop;
|
||||||
$('#' + graph_id).parent().offset().top;
|
console.log(offset);
|
||||||
$('#menu_' + graph_id)
|
$('#menu_' + graph_id).css('top', ((offset) + 'px'));
|
||||||
.css('top',
|
|
||||||
((offset_between_graph_and_div_graph_container - menu_height - 5) + 'px'));
|
|
||||||
|
|
||||||
//$('#legend_' + graph_id).css('width',plot.width());
|
//$('#legend_' + graph_id).css('width',plot.width());
|
||||||
|
|
||||||
$('#menu_' + graph_id)
|
//~ $('#menu_' + graph_id).css('left', $('#'+graph_id)[0].offsetWidth);
|
||||||
.css('left',width - $('#menu_'+graph_id).width());
|
|
||||||
$('#menu_' + graph_id).show();
|
$('#menu_' + graph_id).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -203,7 +203,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 !important;'></p>";
|
$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;
|
$menu_width = 25 * $nbuttons + 15;
|
||||||
if ( $dashboard == false AND $vconsole == false) {
|
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; " .
|
"style='display: none; " .
|
||||||
"text-align: center; " .
|
"text-align: center;" .
|
||||||
"width: " . $menu_width . "px; ".
|
"position: relative;".
|
||||||
"border-bottom: 0px; " .
|
"border-bottom: 0px;'>
|
||||||
"padding: 4px 4px 4px 4px;margin-bottom:5px;'>
|
|
||||||
<a href='javascript:'><img id='menu_cancelzoom_$graph_id' src='".$homeurl."images/zoom_cross_grey.disabled.png' alt='".__('Cancel zoom')."' title='".__('Cancel zoom')."'></a>";
|
<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) {
|
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>";
|
$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 .= " <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 .= "</div>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$return .= html_print_input_hidden('line_width_graph', $config['custom_graph_width'], true);
|
$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;
|
$height = 1;
|
||||||
}
|
}
|
||||||
if (!$dashboard && !$vconsole)
|
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 != '') {
|
if ($water_mark != '') {
|
||||||
$return .= "<div id='watermark_$graph_id' style='display:none; position:absolute;'><img id='watermark_image_$graph_id' src='$water_mark'></div>";
|
$return .= "<div id='watermark_$graph_id' style='display:none; position:absolute;'><img id='watermark_image_$graph_id' src='$water_mark'></div>";
|
||||||
|
|
|
@ -201,7 +201,7 @@ $alias = db_get_value ("alias","tagente","id_agente",$id_agent);
|
||||||
// log4x doesnt support flash yet
|
// log4x doesnt support flash yet
|
||||||
//
|
//
|
||||||
if ($config['flash_charts'] == 1)
|
if ($config['flash_charts'] == 1)
|
||||||
echo '<div style="margin-left: 70px; padding-top: 10px;">';
|
echo '<div style="margin-left: 100px; padding-top: 10px;">';
|
||||||
else
|
else
|
||||||
echo '<div style="margin-left: 50px; padding-top: 10px;">';
|
echo '<div style="margin-left: 50px; padding-top: 10px;">';
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue