diff --git a/pandora_console/include/ajax/graph.ajax.php b/pandora_console/include/ajax/graph.ajax.php index 1b537f8a48..ac7decf965 100644 --- a/pandora_console/include/ajax/graph.ajax.php +++ b/pandora_console/include/ajax/graph.ajax.php @@ -64,7 +64,7 @@ if ($print_custom_graph) { $ttl = (int) get_parameter('ttl', 1); $dashboard = (bool) get_parameter('dashboard'); $vconsole = (bool) get_parameter('vconsole'); - + echo custom_graphs_print($id_graph, $height, $width, $period, $stacked, true, $date, $only_image, $background_color, $modules_param, $homeurl, $name_list, $unit_list, $show_last, $show_max, @@ -102,13 +102,14 @@ if ($print_sparse_graph) { $percentil = get_parameter('percentil', null); $dashboard = (bool) get_parameter('dashboard'); $vconsole = (bool) get_parameter('vconsole'); + $type_g = get_parameter('type_g', $config['type_module_charts']); echo grafico_modulo_sparse($agent_module_id, $period, $show_events, $width, $height , $title, $unit_name, $show_alerts, $avg_only, $pure, $date, $unit, $baseline, $return_data, $show_title, $only_image, $homeurl, $ttl, $projection, $adapt_key, $compare, $show_unknown, $menu, $backgroundColor, $percentil, - $dashboard, $vconsole, $config['type_module_charts']); + $dashboard, $vconsole, $type_g); return; } diff --git a/pandora_console/operation/agentes/graphs.php b/pandora_console/operation/agentes/graphs.php index ff1d7bf9e3..e33d499fe8 100644 --- a/pandora_console/operation/agentes/graphs.php +++ b/pandora_console/operation/agentes/graphs.php @@ -38,8 +38,8 @@ $start_date = get_parameter ("start_date", date("Y-m-d")); $draw_events = get_parameter ("draw_events", 0); $modules = get_parameter('modules', array()); $filter = get_parameter('filter', 0); -$combined = (bool)get_parameter('combined', 1); - +$combined = get_parameter('combined', 1); +$option_type = get_parameter('option_type', 0); //---------------------------------------------------------------------- // Get modules of agent sorted as: @@ -159,7 +159,6 @@ $table->data[0][1] = html_print_select($list_modules, 'modules[]', $table->rowspan[2][0] = 7; $table->data[2][0] = ""; - $table->data[2][1] = __('Begin date'); $table->data[2][2] = html_print_input_text ("start_date", substr ($start_date, 0, 10),'', 10, 40, true); $table->data[2][2] .= html_print_image ("images/calendar_view_day.png", true, array ("onclick" => "scwShow(scwID('text-start_date'),this);")); @@ -174,12 +173,17 @@ $table->data[5][2] = __('Show alerts') . ui_print_help_tip(__('the combined graph does not show the alerts into this graph'), true); $table->data[5][3] = html_print_checkbox ("draw_alerts", 1, (bool) $draw_alerts, true); $table->data[6][2] = __('Show as one combined graph'); -$table->data[6][3] = - html_print_radio_button('combined', 1, __('one combined graph'), - $combined, true); -$table->data[6][3] .= - html_print_radio_button('combined', 0, __('several graphs for each module'), - $combined, true); +$graph_option_one_or_several = array(0 => __('several graphs for each module'), 1 => __('One combined graph')); +$table->data[6][3] = html_print_select($graph_option_one_or_several, 'combined', $combined, '', '', 1, true); + +$table->data[7][2] = __('Chart type'); +if ($combined == 1) { + $graph_option_type = array(0 => __('Area'), 1 => __('Area stack'), 2 => __('Line'), 3 => __('Line stack')); +} +else { + $graph_option_type = array(0 => __('Area'), 2 => __('Line')); +} +$table->data[7][3] = html_print_select($graph_option_type, 'option_type', $option_type, '', '', 1, true); $htmlForm = '