fixed errors in graphs

This commit is contained in:
daniel 2017-02-16 11:18:42 +01:00
parent fdb19d309d
commit d0faeb3ec1
8 changed files with 15 additions and 13 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -720,6 +720,8 @@ if ($list_modules) {
if (empty ($modules)) {
$modules = array ();
}
$table = new stdClass();
$table->width = "100%";
$table->cellpadding = 4;
$table->cellspacing = 4;

View File

@ -4058,7 +4058,7 @@ function grafico_modulo_boolean ($agent_module_id, $period, $show_events,
'file' => $config['homedir'] . "/images/logo_vertical_water.png",
'url' => ui_get_full_url("/images/logo_vertical_water.png",
false, false, false));
$type_graph = $config['type_module_charts'];
if ($type_graph === 'area') {
if ($compare === 'separated') {
return area_graph($flash_chart, $chart, $width, $height/2, $color, $legend,

View File

@ -170,6 +170,7 @@ function html_print_side_layer ($params) {
$out_html = '<div id="side_layer" class="menu_sidebar ' . $round_class . '" style="display:none; z-index:1; overflow: hidden; height: ' . $params['height'] . '; width: ' . $params['width'] . ';">';
$table = new stdClass();
$table->id = 'side_layer_layout';
$table->width = $params['width'] . 'px';
$table->cellspacing = 2;

View File

@ -3710,6 +3710,7 @@ function reporting_get_event_histogram ($events, $text_header_event = false) {
);
}
}
$table = new stdClass();
if (!$text_header_event) {
$table->width = '100%';
}

View File

@ -2251,9 +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 = 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 top_pos = 6;
context.drawImage(this, left_pos, top_pos);
}, false);

View File

@ -208,8 +208,6 @@ function flot_area_graph($chart_data, $width, $height, $color, $legend,
$return .= "<p id='legend_$graph_id' class='legend_graph' style='font-size:".$font_size."pt'></p>";
if (!empty($threshold_data)) {
html_debug($threshold_data, true);
html_debug($yellow_threshold, true);
$yellow_up = $threshold_data['yellow_up'];
$red_up = $threshold_data['red_up'];
$yellow_inverse = $threshold_data['yellow_inverse'];
@ -228,9 +226,6 @@ function flot_area_graph($chart_data, $width, $height, $color, $legend,
$red_up = $module_data['max_critical'];
$yellow_inverse = !($module_data['warning_inverse'] == 0);
$red_inverse = !($module_data['critical_inverse'] == 0);
html_debug($yellow_up, true);
html_debug($yellow_threshold, true);
html_debug($yellow_inverse, true);
}
}

View File

@ -152,6 +152,7 @@ $id = get_parameter('id');
$width = get_parameter ("width", STATWIN_DEFAULT_CHART_WIDTH);
$height = get_parameter ("height", STATWIN_DEFAULT_CHART_HEIGHT);
$label = get_parameter ("label", "");
$label_graph = base64_decode(get_parameter ("label", ""));
$start_date = get_parameter ("start_date", date("Y/m/d"));
$start_time = get_parameter ("start_time", date("H:i:s"));
$draw_events = get_parameter ("draw_events", 0);
@ -204,7 +205,7 @@ $id = get_parameter('id');
switch ($graph_type) {
case 'boolean':
echo grafico_modulo_boolean ($id, $period, $draw_events,
$width, $height, $label, $unit, $draw_alerts,
$width, $height, $label_graph, $unit, $draw_alerts,
$avg_only, false, $date, false, $urlImage,
'adapter_' . $graph_type, $time_compare,
$unknown_graph);
@ -216,7 +217,7 @@ $id = get_parameter('id');
break;
case 'sparse':
echo grafico_modulo_sparse ($id, $period, $draw_events,
$width, $height, $label, $unit, $draw_alerts,
$width, $height, $label_graph, $unit, $draw_alerts,
$avg_only, false, $date, $unit, $baseline, 0, true,
false, $urlImage, 1, false,
'adapter_' . $graph_type, $time_compare,
@ -230,7 +231,7 @@ $id = get_parameter('id');
break;
case 'string':
echo grafico_modulo_string ($id, $period, $draw_events,
$width, $height, $label, null, $draw_alerts, 1,
$width, $height, $label_graph, null, $draw_alerts, 1,
false, $date, false, $urlImage,
'adapter_' . $graph_type);
echo '<br>';
@ -241,7 +242,7 @@ $id = get_parameter('id');
break;
case 'log4x':
echo grafico_modulo_log4x ($id, $period, $draw_events,
$width, $height, $label, $unit, $draw_alerts, 1,
$width, $height, $label_graph, $unit, $draw_alerts, 1,
$pure, $date);
echo '<br>';
if ($show_events_graph)
@ -398,6 +399,7 @@ $id = get_parameter('id');
unset($table);
$table = new stdClass();
$table->id = 'stat_win_form';
$table->width = '100%';
$table->cellspacing = 2;