add tip reports simple graph

This commit is contained in:
daniel 2017-09-22 11:39:54 +02:00
parent e73e20e98c
commit feae62f11c
3 changed files with 18 additions and 5 deletions

View File

@ -94,6 +94,7 @@ $inventory_modules = array();
$date = null;
// Only avg is selected by default for the simple graphs
$only_avg = true;
$fullscale = false;
$percentil = false;
$time_compare_overlapped = false;
@ -212,6 +213,7 @@ switch ($action) {
break;
case 'simple_graph':
$only_avg = isset($style['only_avg']) ? (bool) $style['only_avg'] : true;
$fullscale = isset($style['fullscale']) ? (bool) $style['fullscale'] : 0;
$percentil = isset($style['percentil']) ? $config['percentil'] : 0;
// The break hasn't be forgotten.
case 'simple_baseline_graph':
@ -1353,6 +1355,10 @@ You can of course remove the warnings, that's why we include the source and do n
<td style="font-weight:bold;"><?php echo __('Only average');?></td>
<td><?php html_print_checkbox('only_avg', 1, $only_avg);?></td>
</tr>
<tr id="row_fullscale" style="" class="datos">
<td style="font-weight:bold;"><?php echo __('Full resolution graph (TIP)');?></td>
<td><?php html_print_checkbox('fullscale', 1, $fullscale);?></td>
</tr>
<tr id="row_percentil" style="" class="datos">
<td style="font-weight:bold;"><?php echo __('Percentil');?></td>
<td><?php html_print_checkbox('percentil', 1, $percentil);?></td>
@ -2643,6 +2649,7 @@ function chooseType() {
$("#row_show_graph").hide();
$("#row_max_min_avg").hide();
$("#row_only_avg").hide();
$("#row_fullscale").hide();
$("#row_time_compare_overlapped").hide();
$("#row_quantity").hide();
$("#row_exception_condition_value").hide();
@ -2725,6 +2732,7 @@ function chooseType() {
case 'simple_graph':
$("#row_time_compare_overlapped").show();
$("#row_only_avg").show();
$("#row_fullscale").show();
if ($("#checkbox-percentil").prop("checked"))
$("#row_percentil").show();
// The break hasn't be forgotten, this element

View File

@ -1174,6 +1174,7 @@ switch ($action) {
// the modification of the database for compatibility reasons.
$style['only_avg'] = (int) get_parameter('only_avg');
$style['percentil'] = (int) get_parameter('percentil');
$style['fullscale'] = (int) get_parameter('fullscale');
if ($label != '')
$style['label'] = $label;
else
@ -1518,6 +1519,7 @@ switch ($action) {
// the modification of the database for compatibility reasons.
$style['only_avg'] = (int) get_parameter('only_avg');
$style['percentil'] = (int) get_parameter('percentil');
$style['fullscale'] = (int) get_parameter('fullscale');
if ($label != '')
$style['label'] = $label;
else

View File

@ -6035,12 +6035,14 @@ function reporting_simple_graph($report, $content, $type = 'dinamic',
$only_avg = (bool) $content['style']['only_avg'];
}
if (isset($content['style']['fullscale'])) {
$fullscale = (bool) $content['style']['fullscale'];
}
$moduletype_name = modules_get_moduletype_name(
modules_get_agentmodule_type(
$content['id_agent_module']));
$return['chart'] = '';
// Get chart
reporting_set_conf_charts($width, $height, $only_image, $type,
@ -6114,7 +6116,8 @@ function reporting_simple_graph($report, $content, $type = 'dinamic',
($content['style']['percentil'] == 1) ? $config['percentil'] : null,
false,
false,
$config['type_module_charts']);
$config['type_module_charts'],
$fullscale);
}
break;
case 'data':