diff --git a/pandora_console/include/ajax/visual_console_builder.ajax.php b/pandora_console/include/ajax/visual_console_builder.ajax.php
index 27f58967fe..e1b276d967 100755
--- a/pandora_console/include/ajax/visual_console_builder.ajax.php
+++ b/pandora_console/include/ajax/visual_console_builder.ajax.php
@@ -144,7 +144,7 @@ switch ($action) {
case 'get_module_type_string':
$data = array ();
-
+
$layoutData = db_get_row_filter('tlayout_data', array('id' => $id_element));
if ($layoutData['id_metaconsole'] != 0) {
@@ -158,7 +158,7 @@ switch ($action) {
$is_string = db_get_value_filter ('id_tipo_modulo', 'tagente_modulo',
array ('id_agente' => $id_agent,
'id_agente_modulo' => $id_module));
- html_debug($is_string, true);
+
if ($layoutData['id_metaconsole'] != 0) {
metaconsole_restore_db();
}
@@ -628,7 +628,7 @@ switch ($action) {
$values['width'] = $width_percentile;
}
if ($bars_graph_type !== null) {
- $values['type_graph'] = $id_custom_graph;
+ $values['type_graph'] = $bars_graph_type;
}
if ($background_color !== null) {
$values['image'] = $background_color;
diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php
index ad5216b58a..265e2506f7 100755
--- a/pandora_console/include/functions_visual_map.php
+++ b/pandora_console/include/functions_visual_map.php
@@ -1160,60 +1160,164 @@ function visual_map_print_item($mode = "read", $layoutData,
if (($is_string == 17) || ($is_string == 23) || ($is_string == 3) ||
($is_string == 10) || ($is_string == 33)) {
+ $color = array();
+
+ $color[0] = array('border' => '#000000',
+ 'color' => $config['graph_color1'],
+ 'alpha' => CHART_DEFAULT_ALPHA);
+ $color[1] = array('border' => '#000000',
+ 'color' => $config['graph_color2'],
+ 'alpha' => CHART_DEFAULT_ALPHA);
+ $color[2] = array('border' => '#000000',
+ 'color' => $config['graph_color3'],
+ 'alpha' => CHART_DEFAULT_ALPHA);
+ $color[3] = array('border' => '#000000',
+ 'color' => $config['graph_color4'],
+ 'alpha' => CHART_DEFAULT_ALPHA);
+ $color[4] = array('border' => '#000000',
+ 'color' => $config['graph_color5'],
+ 'alpha' => CHART_DEFAULT_ALPHA);
+ $color[5] = array('border' => '#000000',
+ 'color' => $config['graph_color6'],
+ 'alpha' => CHART_DEFAULT_ALPHA);
+ $color[6] = array('border' => '#000000',
+ 'color' => $config['graph_color7'],
+ 'alpha' => CHART_DEFAULT_ALPHA);
+ $color[7] = array('border' => '#000000',
+ 'color' => $config['graph_color8'],
+ 'alpha' => CHART_DEFAULT_ALPHA);
+ $color[8] = array('border' => '#000000',
+ 'color' => $config['graph_color9'],
+ 'alpha' => CHART_DEFAULT_ALPHA);
+ $color[9] = array('border' => '#000000',
+ 'color' => $config['graph_color10'],
+ 'alpha' => CHART_DEFAULT_ALPHA);
+ $color[11] = array('border' => '#000000',
+ 'color' => COL_GRAPH9,
+ 'alpha' => CHART_DEFAULT_ALPHA);
+ $color[12] = array('border' => '#000000',
+ 'color' => COL_GRAPH10,
+ 'alpha' => CHART_DEFAULT_ALPHA);
+ $color[13] = array('border' => '#000000',
+ 'color' => COL_GRAPH11,
+ 'alpha' => CHART_DEFAULT_ALPHA);
+ $color[14] = array('border' => '#000000',
+ 'color' => COL_GRAPH12,
+ 'alpha' => CHART_DEFAULT_ALPHA);
+ $color[15] = array('border' => '#000000',
+ 'color' => COL_GRAPH13,
+ 'alpha' => CHART_DEFAULT_ALPHA);
+
$module_data = get_bars_module_data($id_module);
-html_debug($module_data, true);
+ $water_mark = array('file' => '/var/www/html/pandora_console/images/logo_vertical_water.png',
+ 'url' => 'http://localhost/pandora_console/images/logo_vertical_water.png');
+
if ($width == 0) {
if ($layoutData['label_position']=='left') {
- $img = '
'.
- grafico_modulo_sparse($id_module, $period,
- 0, 300, 180, modules_get_agentmodule_name($id_module),null, false, 1, false, 0,
- modules_get_unit($id_module), 0, 0, true, $only_image, '', 1, false, '',
- false, false, false, $layoutData['image'],
- null, true, false, $type_graph) . '
';
+ if ($layoutData['type_graph'] == 'horizontal') {
+ $img = ''.
+ hbar_graph(true, $module_data,
+ 400, 400, $color, array(), array(),
+ ui_get_full_url("images/image_problem.opaque.png", false, false, false),
+ "", "", $water_mark, $config['fontpath'], 6,
+ "", 0, $config['homeurl'], $layoutData['image']) . '
';
+ }
+ else {
+ $img = ''.
+ vbar_graph(true, $module_data,
+ 400, 400, $color, array(), array(),
+ ui_get_full_url("images/image_problem.opaque.png", false, false, false),
+ "", "", $water_mark, $config['fontpath'], 6,
+ "", 0, $config['homeurl'], $layoutData['image'], true) . '
';
+ }
}
elseif($layoutData['label_position']=='right') {
- $img = '' .
- grafico_modulo_sparse($id_module,
- $period, 0, 300, 180, modules_get_agentmodule_name($id_module),null, false,
- 1, false, 0, modules_get_unit($id_module), 0, 0, true, $only_image, '',
- 1, false, '', false, false, false,
- $layoutData['image'], null, true,
- false, $type_graph) . '
';
+ if ($layoutData['type_graph'] == 'horizontal') {
+ $img = ''.
+ hbar_graph(true, $module_data,
+ 400, 400, $color, array(), array(),
+ ui_get_full_url("images/image_problem.opaque.png", false, false, false),
+ "", "", $water_mark, $config['fontpath'], 6,
+ "", 0, $config['homeurl'], $layoutData['image']) . '
';
+ }
+ else {
+ $img = ''.
+ vbar_graph(true, $module_data,
+ 400, 400, $color, array(), array(),
+ ui_get_full_url("images/image_problem.opaque.png", false, false, false),
+ "", "", $water_mark, $config['fontpath'], 6,
+ "", 0, $config['homeurl'], $layoutData['image'], true) . '
';
+ }
}
else {
- $img = grafico_modulo_sparse($id_module,
- $period, 0, 300, 180, modules_get_agentmodule_name($id_module),null, false, 1,
- false, 0, modules_get_unit($id_module), 0, 0, true, $only_image, '',
- 1, false, '', false, false, false,
- $layoutData['image'], null, true, false, $type_graph);
+ if ($layoutData['type_graph'] == 'horizontal') {
+ $img = hbar_graph(true, $module_data,
+ 400, 400, $color, array(), array(),
+ ui_get_full_url("images/image_problem.opaque.png", false, false, false),
+ "", "", $water_mark, $config['fontpath'], 6,
+ "", 0, $config['homeurl'], $layoutData['image']);
+ }
+ else {
+ $img = vbar_graph(true, $module_data,
+ 400, 400, $color, array(), array(),
+ ui_get_full_url("images/image_problem.opaque.png", false, false, false),
+ "", "", $water_mark, $config['fontpath'], 6,
+ "", 0, $config['homeurl'], $layoutData['image'], true);
+ }
}
}
else{
if ($layoutData['label_position']=='left') {
- $img = '' .
- grafico_modulo_sparse($id_module, $period,
- 0, $width, $height, modules_get_agentmodule_name($id_module), null, false, 1,
- false, 0, modules_get_unit($id_module), 0, 0, true, $only_image, '',
- 1, false, '', false, false, false,
- $layoutData['image'], null, true,
- false, $type_graph) . '
';
+ if ($layoutData['type_graph'] == 'horizontal') {
+ $img = ''.
+ hbar_graph(true, $module_data,
+ $width, $width, $color, array(), array(),
+ ui_get_full_url("images/image_problem.opaque.png", false, false, false),
+ "", "", $water_mark, $config['fontpath'], 6,
+ "", 0, $config['homeurl'], $layoutData['image']) . '
';
+ }
+ else {
+ $img = ''.
+ vbar_graph(true, $module_data,
+ $width, $width, $color, array(), array(),
+ ui_get_full_url("images/image_problem.opaque.png", false, false, false),
+ "", "", $water_mark, $config['fontpath'], 6,
+ "", 0, $config['homeurl'], $layoutData['image'], true) . '
';
+ }
}
- elseif ($layoutData['label_position']=='right') {
- $img = '' .
- grafico_modulo_sparse($id_module, $period,
- 0, $width, $height, modules_get_agentmodule_name($id_module), null, false, 1,
- false, 0, modules_get_unit($id_module), 0, 0, true, $only_image,
- '', 1, false, modules_get_unit($id_module), false, false, false,
- $layoutData['image'], null, true,
- false, $type_graph) . '
';
+ elseif($layoutData['label_position']=='right') {
+ if ($layoutData['type_graph'] == 'horizontal') {
+ $img = ''.
+ hbar_graph(true, $module_data,
+ $width, $width, $color, array(), array(),
+ ui_get_full_url("images/image_problem.opaque.png", false, false, false),
+ "", "", $water_mark, $config['fontpath'], 6,
+ "", 0, $config['homeurl'], $layoutData['image']) . '
';
+ }
+ else {
+ $img = ''.
+ vbar_graph(true, $module_data,
+ $width, $width, $color, array(), array(),
+ ui_get_full_url("images/image_problem.opaque.png", false, false, false),
+ "", "", $water_mark, $config['fontpath'], 6,
+ "", 0, $config['homeurl'], $layoutData['image'], true) . '
';
+ }
}
else {
- $img = grafico_modulo_sparse($id_module,
- $period, 0, $width, $height, modules_get_agentmodule_name($id_module), null,
- false, 1, false, 0, modules_get_unit($id_module), 0, 0, true,
- $only_image, '', 1, false, '', false,
- false, false, $layoutData['image'],
- null, false, true, $type_graph);
+ if ($layoutData['type_graph'] == 'horizontal') {
+ $img = hbar_graph(true, $module_data,
+ $width, $width, $color, array(), array(),
+ ui_get_full_url("images/image_problem.opaque.png", false, false, false),
+ "", "", $water_mark, $config['fontpath'], 6,
+ "", 0, $config['homeurl'], $layoutData['image']);
+ }
+ else {
+ $img = vbar_graph(true, $module_data,
+ $width, $width, $color, array(), array(),
+ ui_get_full_url("images/image_problem.opaque.png", false, false, false),
+ "", "", $water_mark, $config['fontpath'], 6,
+ "", 0, $config['homeurl'], $layoutData['image'], true);
+ }
}
}
}
@@ -1931,34 +2035,13 @@ function get_bars_module_data ($id_module) {
$values = explode("\n", $mod_values);
}
- $colors = array();
- $colors[] = "#aa3333";
- $colors[] = "#045FB4";
- $colors[] = "#8181F7";
- $colors[] = "#F78181";
- $colors[] = "#D0A9F5";
- $colors[] = "#BDBDBD";
- $colors[] = "#6AB277";
-
$values_to_return = array();
$index = 0;
$color_index = 0;
$total = 0;
foreach ($values as $val) {
$data = explode(":", $val);
- $values_to_return[$index]['tag_name'] = $data[0] . ", " . $data[1];
- if ($color_index == 6) {
- $color_index = 0;
- }
- $values_to_return[$index]['color'] = $colors[$color_index];
- $values_to_return[$index]['value'] = (int)$data[1];
- $total += (int)$data[1];
- $index++;
- $color_index++;
- }
-
- foreach ($values_to_return as $ind => $bar_data) {
- $values_to_return[$ind]['percent'] = ($bar_data['value'] * 100) / $total;
+ $values_to_return[$data[0]] = array('g' =>$data[1]);
}
return $values_to_return;
diff --git a/pandora_console/include/functions_visual_map_editor.php b/pandora_console/include/functions_visual_map_editor.php
index 8fb0db1abe..b1bae184ae 100755
--- a/pandora_console/include/functions_visual_map_editor.php
+++ b/pandora_console/include/functions_visual_map_editor.php
@@ -146,7 +146,7 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
'';
$form_items['module_graph_size_row'] = array();
- $form_items['module_graph_size_row']['items'] = array('module_graph', 'datos', 'bars_graph');
+ $form_items['module_graph_size_row']['items'] = array('module_graph', 'datos');
$form_items['module_graph_size_row']['html'] = '' . __('Size') . ' |
' .
html_print_input_text('width_module_graph', 300, '', 3, 5, true) .
@@ -465,7 +465,7 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
$form_items['module_graph_size_row'] = array();
- $form_items['module_graph_size_row']['items'] = array('module_graph', 'datos', 'bars_graph');
+ $form_items['module_graph_size_row']['items'] = array('module_graph', 'datos');
$form_items['module_graph_size_row']['html'] = ' | ' . __('Size') . ' |
' .
html_print_input_text('width_module_graph', 300, '', 3, 5, true) .
diff --git a/pandora_console/include/graphs/flot/pandora.flot.js b/pandora_console/include/graphs/flot/pandora.flot.js
index e036a9855e..9024424ab0 100644
--- a/pandora_console/include/graphs/flot/pandora.flot.js
+++ b/pandora_console/include/graphs/flot/pandora.flot.js
@@ -638,7 +638,7 @@ function pandoraFlotVBars(graph_id, values, labels, labels_long, legend, colors,
}
format.push([i,
- ''
+ ' '
+ label
+ ' ']);
}
diff --git a/pandora_console/include/graphs/functions_pchart.php b/pandora_console/include/graphs/functions_pchart.php
index f5368ca4c5..a6637f04ba 100644
--- a/pandora_console/include/graphs/functions_pchart.php
+++ b/pandora_console/include/graphs/functions_pchart.php
@@ -743,13 +743,7 @@ function pch_bar_graph ($graph_type, $index, $data, $width, $height, $font,
$myPicture->setGraphArea($margin_left, $margin_top, $width - $margin_right, $height - $margin_bottom);
$myPicture->drawScale($scaleSettings);
- /*
- if (isset($legend)) {
- /* Write the chart legend
- $size = $myPicture->getLegendSize(array("Style"=>LEGEND_NOBORDER,"Mode"=>LEGEND_HORIZONTAL));
- $myPicture->drawLegend($width-$size['Width'],0,array("Style"=>LEGEND_NOBORDER,"Mode"=>LEGEND_HORIZONTAL, "BoxWidth"=>10, "BoxHeight"=>10));
- }
- */
+
/* Turn on shadow computing */
$myPicture->setShadow(TRUE,array("X"=>0,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10));
|