mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
Now the boolean charts is showed as digital signal charts (only with dinamic flot charts engine)
This commit is contained in:
parent
89d2ddd2dd
commit
3d014c6ab5
@ -3102,6 +3102,8 @@ function grafico_modulo_boolean_data ($agent_module_id, $period, $show_events,
|
|||||||
$series_type['unknown'.$series_suffix] = 'area';
|
$series_type['unknown'.$series_suffix] = 'area';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$series_type['sum' . $series_suffix] = 'boolean';
|
||||||
|
|
||||||
//Boolean graph doesn't have min!!!
|
//Boolean graph doesn't have min!!!
|
||||||
/*if (!$avg_only) {
|
/*if (!$avg_only) {
|
||||||
$chart[$timestamp]['min'.$series_suffix] = 0;
|
$chart[$timestamp]['min'.$series_suffix] = 0;
|
||||||
@ -3231,11 +3233,11 @@ function grafico_modulo_boolean ($agent_module_id, $period, $show_events,
|
|||||||
$series_suffix_str = '';
|
$series_suffix_str = '';
|
||||||
if ($compare !== false) {
|
if ($compare !== false) {
|
||||||
$series_suffix = '2';
|
$series_suffix = '2';
|
||||||
$series_suffix_str = ' ('.__('Previous').')';
|
$series_suffix_str = ' (' . __('Previous') . ')';
|
||||||
// Build the data of the previous period
|
// Build the data of the previous period
|
||||||
grafico_modulo_boolean_data ($agent_module_id, $period, $show_events,
|
grafico_modulo_boolean_data ($agent_module_id, $period, $show_events,
|
||||||
$unit_name, $show_alerts, $avg_only, $date-$period, $series_suffix,
|
$unit_name, $show_alerts, $avg_only, $date-$period, $series_suffix,
|
||||||
$series_suffix_str, $show_unknown);
|
$series_suffix_str, $show_unknown);
|
||||||
switch ($compare) {
|
switch ($compare) {
|
||||||
case 'separated':
|
case 'separated':
|
||||||
// Store the chart calculated
|
// Store the chart calculated
|
||||||
@ -3254,18 +3256,19 @@ function grafico_modulo_boolean ($agent_module_id, $period, $show_events,
|
|||||||
$series_type_prev = $series_type;
|
$series_type_prev = $series_type;
|
||||||
$color_prev = $color;
|
$color_prev = $color;
|
||||||
foreach ($color_prev as $k => $col) {
|
foreach ($color_prev as $k => $col) {
|
||||||
$color_prev[$k]['color'] = '#'.get_complementary_rgb($color_prev[$k]['color']);
|
$color_prev[$k]['color'] = '#' . get_complementary_rgb($color_prev[$k]['color']);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
grafico_modulo_boolean_data ($agent_module_id, $period, $show_events,
|
grafico_modulo_boolean_data ($agent_module_id, $period, $show_events,
|
||||||
$unit_name, $show_alerts, $avg_only, $date, '', '', $show_unknown);
|
$unit_name, $show_alerts, $avg_only, $date, '', '', $show_unknown);
|
||||||
|
|
||||||
if ($compare === 'overlapped') {
|
if ($compare === 'overlapped') {
|
||||||
$i = 0;
|
$i = 0;
|
||||||
foreach ($chart as $k=>$v) {
|
foreach($chart as $k => $v) {
|
||||||
$chart[$k] = array_merge($v,$chart_prev[$i]);
|
$chart[$k] = array_merge($v, $chart_prev[$i]);
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3277,8 +3280,10 @@ function grafico_modulo_boolean ($agent_module_id, $period, $show_events,
|
|||||||
$flash_chart = false;
|
$flash_chart = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$water_mark = array('file' => $config['homedir'] . "/images/logo_vertical_water.png",
|
$water_mark = array(
|
||||||
'url' => ui_get_full_url("/images/logo_vertical_water.png", false, false, false));
|
'file' => $config['homedir'] . "/images/logo_vertical_water.png",
|
||||||
|
'url' => ui_get_full_url("/images/logo_vertical_water.png",
|
||||||
|
false, false, false));
|
||||||
|
|
||||||
if ($compare === 'separated') {
|
if ($compare === 'separated') {
|
||||||
return area_graph($flash_chart, $chart, $width, $height/2, $color, $legend,
|
return area_graph($flash_chart, $chart, $width, $height/2, $color, $legend,
|
||||||
|
@ -568,7 +568,7 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
|
|||||||
alertsz[alert_ids[i]] = v;
|
alertsz[alert_ids[i]] = v;
|
||||||
});
|
});
|
||||||
|
|
||||||
switch(type) {
|
switch (type) {
|
||||||
case 'line_simple':
|
case 'line_simple':
|
||||||
stacked = null;
|
stacked = null;
|
||||||
filled = false;
|
filled = false;
|
||||||
@ -606,15 +606,22 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
switch(serie_types[i]) {
|
switch (serie_types[i]) {
|
||||||
case 'line':
|
case 'line':
|
||||||
default:
|
default:
|
||||||
line_show = true;
|
line_show = true;
|
||||||
points_show = false;
|
points_show = false;
|
||||||
|
steps_chart = false
|
||||||
break;
|
break;
|
||||||
case 'points':
|
case 'points':
|
||||||
line_show = false;
|
line_show = false;
|
||||||
points_show = true;
|
points_show = true;
|
||||||
|
steps_chart = false
|
||||||
|
break;
|
||||||
|
case 'boolean':
|
||||||
|
line_show = true;
|
||||||
|
points_show = false;
|
||||||
|
steps_chart = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -645,15 +652,15 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
|
|||||||
//~ { color: criticalw, yaxis: { from: vcritical_min } },
|
//~ { color: criticalw, yaxis: { from: vcritical_min } },
|
||||||
//~ { color: criticalw, yaxis: { to: -1 } }
|
//~ { color: criticalw, yaxis: { to: -1 } }
|
||||||
//~ ];
|
//~ ];
|
||||||
|
|
||||||
lineWidht = $('#hidden-lineWidhtGraph');
|
lineWidht = $('#hidden-lineWidhtGraph');
|
||||||
if (typeof(lineWidht[0])=='undefined'){
|
if (typeof(lineWidht[0])=='undefined') {
|
||||||
WidhtLine = 1;
|
WidhtLine = 1;
|
||||||
}
|
}
|
||||||
else{
|
else {
|
||||||
WidhtLine = lineWidht[0].value;
|
WidhtLine = lineWidht[0].value;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Data
|
// Data
|
||||||
data_base.push({
|
data_base.push({
|
||||||
id: 'serie_' + i,
|
id: 'serie_' + i,
|
||||||
@ -661,13 +668,15 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
|
|||||||
label: legend[i],
|
label: legend[i],
|
||||||
color: serie_color,
|
color: serie_color,
|
||||||
//threshold: [{ below: 80, color: "rgb(200, 20, 30)" } , { below: 65, color: "rgb(30, 200, 30)" }, { below: 50, color: "rgb(30, 200, 30)" }],
|
//threshold: [{ below: 80, color: "rgb(200, 20, 30)" } , { below: 65, color: "rgb(30, 200, 30)" }, { below: 50, color: "rgb(30, 200, 30)" }],
|
||||||
lines: { show: line_show,
|
lines: {
|
||||||
|
show: line_show,
|
||||||
fill: filled,
|
fill: filled,
|
||||||
fillColor: {
|
fillColor: {
|
||||||
colors: [ { opacity: 0.9 }, { opacity: 0.9 } ]
|
colors: [ { opacity: 0.9 }, { opacity: 0.9 } ]
|
||||||
},
|
},
|
||||||
lineWidth: WidhtLine,
|
lineWidth: WidhtLine,
|
||||||
steps: false },
|
steps: steps_chart
|
||||||
|
},
|
||||||
points: { show: points_show }
|
points: { show: points_show }
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -187,7 +187,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'></p>";
|
||||||
$return .= "<div id='timestamp_$graph_id' class='timestamp_graph' style='font-size:".$font_size."pt;display:none; position:absolute; background:#fff; border: solid 1px #aaa; padding: 2px; z-index:1000;'></div>";
|
$return .= "<div id='timestamp_$graph_id' class='timestamp_graph' style='font-size:".$font_size."pt;display:none; position:absolute; background:#fff; border: solid 1px #aaa; padding: 2px; z-index:1000;'></div>";
|
||||||
$return .= "<div id='$graph_id' class='graph $adapt_key' style='width: ".$width."px; height: ".$height."px;'></div>";
|
$return .= "<div id='$graph_id' class='graph $adapt_key' style='width: ".$width."px; height: ".$height."px;'></div>";
|
||||||
if ($menu) {
|
if ($menu) {
|
||||||
@ -229,7 +229,7 @@ function flot_area_graph($chart_data, $width, $height, $color, $legend,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($chart_data as $label => $values) {
|
foreach ($chart_data as $label => $values) {
|
||||||
$labels[] = io_safe_output($label);
|
$labels[] = io_safe_output($label);
|
||||||
|
|
||||||
foreach($values as $key => $value) {
|
foreach($values as $key => $value) {
|
||||||
@ -308,7 +308,7 @@ function flot_area_graph($chart_data, $width, $height, $color, $legend,
|
|||||||
}
|
}
|
||||||
$extra_width = (int)($width / 3);
|
$extra_width = (int)($width / 3);
|
||||||
|
|
||||||
$return .= "<div id='extra_$graph_id' style='font-size: ".$font_size."pt; display:none; position:absolute; overflow: auto; max-height: ".($height+50)."px; width: ".$extra_width."px; background:#fff; padding: 2px 2px 2px 2px; border: solid #000 1px;'></div>";
|
$return .= "<div id='extra_$graph_id' style='font-size: " . $font_size . "pt; display:none; position:absolute; overflow: auto; max-height: ".($height+50)."px; width: ".$extra_width."px; background:#fff; padding: 2px 2px 2px 2px; border: solid #000 1px;'></div>";
|
||||||
|
|
||||||
// Process extra data
|
// Process extra data
|
||||||
$events = array();
|
$events = array();
|
||||||
|
@ -701,7 +701,7 @@ function pch_vertical_graph ($graph_type, $index, $data, $width, $height,
|
|||||||
$MyData->setSerieDescription("Xaxis", $xaxisname);
|
$MyData->setSerieDescription("Xaxis", $xaxisname);
|
||||||
$MyData->setAbscissa("Xaxis");
|
$MyData->setAbscissa("Xaxis");
|
||||||
$MyData->setAxisDisplay(0, AXIS_FORMAT_METRIC);
|
$MyData->setAxisDisplay(0, AXIS_FORMAT_METRIC);
|
||||||
|
|
||||||
switch($backgroundColor) {
|
switch($backgroundColor) {
|
||||||
case 'white':
|
case 'white':
|
||||||
$transparent = false;
|
$transparent = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user