Now the boolean charts is showed as digital signal charts (only with dinamic flot charts engine)

(cherry picked from commit 3d014c6ab5)

Conflicts:
	pandora_console/include/graphs/flot/pandora.flot.js
	pandora_console/include/graphs/functions_flot.php
This commit is contained in:
mdtrooper 2015-08-25 13:00:46 +02:00
parent 4a30988146
commit 1577621b5b
4 changed files with 1275 additions and 1443 deletions

View File

@ -3223,6 +3223,8 @@ function grafico_modulo_boolean_data ($agent_module_id, $period, $show_events,
$series_type['unknown'.$series_suffix] = 'area';
}
$series_type['sum' . $series_suffix] = 'boolean';
//Boolean graph doesn't have min!!!
/*if (!$avg_only) {
$chart[$timestamp]['min'.$series_suffix] = 0;
@ -3352,11 +3354,11 @@ function grafico_modulo_boolean ($agent_module_id, $period, $show_events,
$series_suffix_str = '';
if ($compare !== false) {
$series_suffix = '2';
$series_suffix_str = ' ('.__('Previous').')';
$series_suffix_str = ' (' . __('Previous') . ')';
// Build the data of the previous period
grafico_modulo_boolean_data ($agent_module_id, $period, $show_events,
$unit_name, $show_alerts, $avg_only, $date-$period, $series_suffix,
$series_suffix_str, $show_unknown);
$unit_name, $show_alerts, $avg_only, $date-$period, $series_suffix,
$series_suffix_str, $show_unknown);
switch ($compare) {
case 'separated':
// Store the chart calculated
@ -3375,18 +3377,19 @@ function grafico_modulo_boolean ($agent_module_id, $period, $show_events,
$series_type_prev = $series_type;
$color_prev = $color;
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;
}
}
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') {
$i = 0;
foreach ($chart as $k=>$v) {
$chart[$k] = array_merge($v,$chart_prev[$i]);
foreach($chart as $k => $v) {
$chart[$k] = array_merge($v, $chart_prev[$i]);
$i++;
}
@ -3398,8 +3401,10 @@ function grafico_modulo_boolean ($agent_module_id, $period, $show_events,
$flash_chart = false;
}
$water_mark = array('file' => $config['homedir'] . "/images/logo_vertical_water.png",
'url' => ui_get_full_url("/images/logo_vertical_water.png", false, false, false));
$water_mark = array(
'file' => $config['homedir'] . "/images/logo_vertical_water.png",
'url' => ui_get_full_url("/images/logo_vertical_water.png",
false, false, false));
if ($config['type_module_charts'] === 'area') {
if ($compare === 'separated') {

File diff suppressed because it is too large Load Diff

View File

@ -264,7 +264,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);
foreach($values as $key => $value) {
@ -328,7 +328,7 @@ function flot_area_graph($chart_data, $width, $height, $color, $legend,
$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
$events = array();

View File

@ -696,7 +696,7 @@ function pch_vertical_graph ($graph_type, $index, $data, $width, $height,
$MyData->setSerieDescription("Xaxis", $xaxisname);
$MyData->setAbscissa("Xaxis");
$MyData->setAxisDisplay(0, AXIS_FORMAT_METRIC);
switch($backgroundColor) {
case 'white':
$transparent = false;