diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php
index d6a0eb3eef..ccc1622be0 100644
--- a/pandora_console/include/functions_graph.php
+++ b/pandora_console/include/functions_graph.php
@@ -1720,7 +1720,6 @@ function graphic_combined_module ($module_list, $weight_list, $period,
'color' => COL_GRAPH13,
'alpha' => CHART_DEFAULT_ALPHA);
-
switch ($stacked) {
case CUSTOM_GRAPH_AREA:
return area_graph($flash_charts, $graph_values, $width,
diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php
index fc658dfe14..404a3d4ddd 100755
--- a/pandora_console/include/functions_visual_map.php
+++ b/pandora_console/include/functions_visual_map.php
@@ -768,12 +768,14 @@ function visual_map_print_item($mode = "read", $layoutData,
}
}
+ $only_image = !$graph_javascript || $isExternalLink;
if ($layoutData['id_custom_graph'] != 0) {
+ // Show only avg on the visual console
$img = custom_graphs_print(
$layoutData['id_custom_graph'], $height, $width,
- $period, null, true, 0, true, $layoutData['image'],
- array(), '', array(), array(), true,
- true, true, true, 1, false, $graph_javascript);
+ $period, null, true, 0, $only_image, $layoutData['image'],
+ array(), '', array(), array(), false,
+ false, false, true, 1, false, true);
}
else {
if ($isExternalLink)
@@ -783,8 +785,8 @@ function visual_map_print_item($mode = "read", $layoutData,
$img = grafico_modulo_sparse($id_module, $period, 0, $width,
$height, '', null, false, 1, false, 0, '', 0, 0,
- true, true, $homeurl, 1, false, '', false, false, true,
- $layoutData['image'], null, false, $graph_javascript);
+ true, $only_image, $homeurl, 1, false, '', false, false, false,
+ $layoutData['image'], null, false, true);
}
//Restore db connection
diff --git a/pandora_console/include/graphs/fgraph.php b/pandora_console/include/graphs/fgraph.php
index 2ee160d3b0..9d9808c46c 100644
--- a/pandora_console/include/graphs/fgraph.php
+++ b/pandora_console/include/graphs/fgraph.php
@@ -238,6 +238,8 @@ function area_graph($flash_chart, $chart_data, $width, $height, $color,
return graph_nodata_image($width, $height);
return '';
}
+
+ $menu = (!$dashboard && !$vconsole);
if ($flash_chart) {
return flot_area_simple_graph(
@@ -260,60 +262,34 @@ function area_graph($flash_chart, $chart_data, $width, $height, $color,
$menu,
$backgroundColor,
$dashboard,
- false,
+ $vconsole,
$agent_module_id);
}
else {
- if ($vconsole) {
- return flot_area_simple_graph(
- $chart_data,
- $width,
- $height,
- $color,
- $legend,
- $long_index,
- $homeurl,
- $unit,
- $water_mark_url,
- $series_type,
- $chart_extra_data,
- $yellow_threshold,
- $red_threshold,
- $adapt_key,
- $force_integer,
- $series_suffix_str,
- $menu,
- $backgroundColor,
- $dashboard,
- $vconsole,
- $agent_module_id);
- }
- else {
- $graph = array();
- $graph['data'] = $chart_data;
- $graph['width'] = $width;
- $graph['height'] = $height;
- $graph['color'] = $color;
- $graph['legend'] = $legend;
- $graph['xaxisname'] = $xaxisname;
- $graph['yaxisname'] = $yaxisname;
- $graph['water_mark'] = $water_mark_file;
- $graph['font'] = $font;
- $graph['font_size'] = $font_size;
- $graph['backgroundColor'] = $backgroundColor;
- $graph['unit'] = $unit;
- $graph['series_type'] = $series_type;
-
- $id_graph = serialize_in_temp($graph, null, $ttl);
- // Warning: This string is used in the function "api_get_module_graph" from 'functions_api.php' with the regec patern "//"
- return "";
- }
+ $graph = array();
+ $graph['data'] = $chart_data;
+ $graph['width'] = $width;
+ $graph['height'] = $height;
+ $graph['color'] = $color;
+ $graph['legend'] = $legend;
+ $graph['xaxisname'] = $xaxisname;
+ $graph['yaxisname'] = $yaxisname;
+ $graph['water_mark'] = $water_mark_file;
+ $graph['font'] = $font;
+ $graph['font_size'] = $font_size;
+ $graph['backgroundColor'] = $backgroundColor;
+ $graph['unit'] = $unit;
+ $graph['series_type'] = $series_type;
+
+ $id_graph = serialize_in_temp($graph, null, $ttl);
+ // Warning: This string is used in the function "api_get_module_graph" from 'functions_api.php' with the regec patern "//"
+ return "";
}
}
@@ -328,6 +304,8 @@ function stacked_area_graph($flash_chart, $chart_data, $width, $height,
if (empty($chart_data)) {
return '';
}
+
+ $menu = (!$dashboard && !$vconsole);
if ($flash_chart) {
return flot_area_stacked_graph(
@@ -347,57 +325,33 @@ function stacked_area_graph($flash_chart, $chart_data, $width, $height,
'',
false,
'',
- true,
+ $menu,
$backgroundColor,
- $dashboard);
+ $dashboard,
+ $vconsole,
+ $agent_module_id);
}
else {
- if ($vconsole) {
- return flot_area_stacked_graph(
- $chart_data,
- $width,
- $height,
- $color,
- $legend,
- $long_index,
- $homeurl,
- $unit,
- $water_mark_url,
- array(),
- array(),
- 0,
- 0,
- '',
- false,
- '',
- true,
- $backgroundColor,
- $dashboard,
- $vconsole,
- $agent_module_id);
- }
- else {
- //Stack the data
- stack_data($chart_data, $legend, $color);
-
- $graph = array();
- $graph['data'] = $chart_data;
- $graph['width'] = $width;
- $graph['height'] = $height;
- $graph['color'] = $color;
- $graph['legend'] = $legend;
- $graph['xaxisname'] = $xaxisname;
- $graph['yaxisname'] = $yaxisname;
- $graph['water_mark'] = $water_mark_file;
- $graph['font'] = $font;
- $graph['font_size'] = $font_size;
- $graph['backgroundColor'] = $backgroundColor;
-
- $id_graph = serialize_in_temp($graph, null, $ttl);
-
- return "";
- }
+ //Stack the data
+ stack_data($chart_data, $legend, $color);
+
+ $graph = array();
+ $graph['data'] = $chart_data;
+ $graph['width'] = $width;
+ $graph['height'] = $height;
+ $graph['color'] = $color;
+ $graph['legend'] = $legend;
+ $graph['xaxisname'] = $xaxisname;
+ $graph['yaxisname'] = $yaxisname;
+ $graph['water_mark'] = $water_mark_file;
+ $graph['font'] = $font;
+ $graph['font_size'] = $font_size;
+ $graph['backgroundColor'] = $backgroundColor;
+
+ $id_graph = serialize_in_temp($graph, null, $ttl);
+
+ return "";
}
}
@@ -413,6 +367,7 @@ function stacked_line_graph($flash_chart, $chart_data, $width, $height,
return '';
}
+ $menu = (!$dashboard && !$vconsole);
if ($flash_chart) {
return flot_line_stacked_graph(
@@ -432,55 +387,31 @@ function stacked_line_graph($flash_chart, $chart_data, $width, $height,
'',
false,
'',
- true,
+ $menu,
$background_color,
- $dashboard);
+ $dashboard,
+ $vconsole);
}
else {
- if ($vconsole) {
- return flot_line_stacked_graph(
- $chart_data,
- $width,
- $height,
- $color,
- $legend,
- $long_index,
- $homeurl,
- $unit,
- $water_mark_url,
- array(),
- array(),
- 0,
- 0,
- '',
- false,
- '',
- true,
- $background_color,
- $dashboard,
- $vconsole);
- }
- else {
- //Stack the data
- stack_data($chart_data, $legend, $color);
-
- $graph = array();
- $graph['data'] = $chart_data;
- $graph['width'] = $width;
- $graph['height'] = $height;
- $graph['color'] = $color;
- $graph['legend'] = $legend;
- $graph['xaxisname'] = $xaxisname;
- $graph['yaxisname'] = $yaxisname;
- $graph['water_mark'] = $water_mark_file;
- $graph['font'] = $font;
- $graph['font_size'] = $font_size;
- $graph['backgroundColor'] = $backgroundColor;
-
- $id_graph = serialize_in_temp($graph, null, $ttl);
-
- return "";
- }
+ //Stack the data
+ stack_data($chart_data, $legend, $color);
+
+ $graph = array();
+ $graph['data'] = $chart_data;
+ $graph['width'] = $width;
+ $graph['height'] = $height;
+ $graph['color'] = $color;
+ $graph['legend'] = $legend;
+ $graph['xaxisname'] = $xaxisname;
+ $graph['yaxisname'] = $yaxisname;
+ $graph['water_mark'] = $water_mark_file;
+ $graph['font'] = $font;
+ $graph['font_size'] = $font_size;
+ $graph['backgroundColor'] = $backgroundColor;
+
+ $id_graph = serialize_in_temp($graph, null, $ttl);
+
+ return "";
}
}
@@ -550,6 +481,8 @@ function line_graph($flash_chart, $chart_data, $width, $height, $color,
if (empty($chart_data)) {
return '';
}
+
+ $menu = (!$dashboard && !$vconsole);
if ($flash_chart) {
return flot_line_simple_graph(
@@ -569,52 +502,28 @@ function line_graph($flash_chart, $chart_data, $width, $height, $color,
'',
false,
'',
- true,
+ $menu,
$backgroundColor,
- $dashboard);
+ $dashboard,
+ $vconsole);
}
else {
- if ($vconsole) {
- return flot_line_simple_graph(
- $chart_data,
- $width,
- $height,
- $color,
- $legend,
- $long_index,
- $homeurl,
- $unit,
- $water_mark_url,
- array(),
- array(),
- 0,
- 0,
- '',
- false,
- '',
- true,
- $backgroundColor,
- $dashboard,
- $vconsole);
- }
- else {
- $graph = array();
- $graph['data'] = $chart_data;
- $graph['width'] = $width;
- $graph['height'] = $height;
- $graph['color'] = $color;
- $graph['legend'] = $legend;
- $graph['xaxisname'] = $xaxisname;
- $graph['yaxisname'] = $yaxisname;
- $graph['water_mark'] = $water_mark_file;
- $graph['font'] = $font;
- $graph['font_size'] = $font_size;
- $graph['backgroundColor'] = $backgroundColor;
-
- $id_graph = serialize_in_temp($graph, null, $ttl);
-
- return "";
- }
+ $graph = array();
+ $graph['data'] = $chart_data;
+ $graph['width'] = $width;
+ $graph['height'] = $height;
+ $graph['color'] = $color;
+ $graph['legend'] = $legend;
+ $graph['xaxisname'] = $xaxisname;
+ $graph['yaxisname'] = $yaxisname;
+ $graph['water_mark'] = $water_mark_file;
+ $graph['font'] = $font;
+ $graph['font_size'] = $font_size;
+ $graph['backgroundColor'] = $backgroundColor;
+
+ $id_graph = serialize_in_temp($graph, null, $ttl);
+
+ return "";
}
}
diff --git a/pandora_console/operation/visual_console/render_view.php b/pandora_console/operation/visual_console/render_view.php
index 986b8d603a..733432e93b 100755
--- a/pandora_console/operation/visual_console/render_view.php
+++ b/pandora_console/operation/visual_console/render_view.php
@@ -42,7 +42,7 @@ else {
}
$refr = (int) get_parameter ('refr', $config['vc_refr']);
-$graph_javascript = (bool) get_parameter ('graph_javascript', false);
+$graph_javascript = (bool) get_parameter ('graph_javascript', true);
$vc_refr = false;
if (isset($config['vc_refr']) and $config['vc_refr'] != 0)