diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js
index ba692f20f3..180b239a78 100755
--- a/pandora_console/godmode/reporting/visual_console_builder.editor.js
+++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js
@@ -632,7 +632,9 @@ function readFields() {
values['height_module_graph'] = $("input[name=height_module_graph]").val();
values['event_max_time_row'] = $("select[name=event_max_time_row]").val();
values['type_percentile'] = $("select[name=type_percentile]").val();
- values['percentile_color'] = $("input[name='percentile_color']").val();
+ values['percentile_color'] = $("input[name=percentile_color]").val();
+ values['percentile_label_color'] = $("input[name=percentile_label_color]").val();
+ values['percentile_label'] = $("input[name=percentile_label]").val();
values['value_show'] = $("select[name=value_show]").val();
values['enable_link'] = $("input[name=enable_link]").is(':checked') ? 1 : 0;
@@ -1283,12 +1285,18 @@ function loadFieldsFromDB(item) {
$("input[name=height_module_graph]").val(val);
if (key == 'type_percentile')
$("select[name=type_percentile]").val(val);
-
+ if (key == 'percentile_label')
+ $("input[name=percentile_label]").val(val);
if (key == 'percentile_color') {
- $("input[name='percentile_color']").val(val);
+ $("input[name=percentile_color]").val(val);
$("#percentile_item_row_5 .ColorPickerDivSample")
.css('background-color', val);
}
+ if (key == 'percentile_label_color') {
+ $("input[name=percentile_label_color]").val(val);
+ $("#percentile_item_row_6 .ColorPickerDivSample")
+ .css('background-color', val);
+ }
if (key == 'value_show') {
$("select[name=value_show]").val(val);
diff --git a/pandora_console/include/ajax/visual_console_builder.ajax.php b/pandora_console/include/ajax/visual_console_builder.ajax.php
index 677e635e1e..a9034f3690 100755
--- a/pandora_console/include/ajax/visual_console_builder.ajax.php
+++ b/pandora_console/include/ajax/visual_console_builder.ajax.php
@@ -119,6 +119,8 @@ $border_width = (int)get_parameter('border_width', 0);
$border_color = get_parameter('border_color', '');
$fill_color = get_parameter('fill_color', '');
$percentile_color = get_parameter('percentile_color', '');
+$percentile_label = get_parameter('percentile_label', '');
+$percentile_label_color = get_parameter('percentile_label_color', '');
$width_box = (int)get_parameter('width_box', 0);
$height_box = (int)get_parameter('height_box', 0);
$line_start_x = (int)get_parameter('line_start_x', 0);
@@ -620,6 +622,8 @@ switch ($action) {
$values['image'] = $value_show;
$values['border_color'] = $percentile_color;
+ $values['fill_color'] = $percentile_label_color;
+ $values['label'] = $percentile_label;
}
break;
case 'icon':
@@ -797,6 +801,8 @@ switch ($action) {
$elementFields['type_percentile'] = 'interior_circular_progress_bar';
}
$elementFields['percentile_color'] = $elementFields['border_color'];
+ $elementFields['percentile_label_color'] = $elementFields['fill_color'];
+ $elementFields['percentile_label'] = $elementFields['label'];
break;
case 'module_graph':
@@ -963,6 +969,8 @@ switch ($action) {
$values['image'] = $value_show; //Hack to save it show percent o value.
$values['width'] = $width_percentile;
$values['height'] = $max_percentile;
+ $values['fill_color'] = $percentile_label_color;
+ $values['label'] = $percentile_label;
break;
case 'static_graph':
$values['type'] = STATIC_GRAPH;
diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php
index 9479805b59..1de86c2543 100755
--- a/pandora_console/include/functions_visual_map.php
+++ b/pandora_console/include/functions_visual_map.php
@@ -1417,45 +1417,17 @@ function visual_map_print_item($mode = "read", $layoutData,
break;
case PERCENTILE_BAR:
- $imgpos = '';
+ if (($layoutData['image'] == 'value') && ($value_text !== false)) {
+ $unit_text = db_get_sql ('SELECT unit
+ FROM tagente_modulo
+ WHERE id_agente_modulo = ' . $id_module);
+ $unit_text = trim(io_safe_output($unit_text));
- if($layoutData['label_position']=='left'){
- $imgpos = 'float:right;';
- }
- else if($layoutData['label_position']=='right'){
- $imgpos = 'float:left;';
- }
-
- $progress_bar_heigh = 15;
- if (!empty($proportion)) {
- if ($width != 0) {
- $width = (integer)($proportion['proportion_width'] * $width);
- }
- else {
- $width = (integer)($proportion['proportion_width'] * $infoImage[0]);
- }
-
- if ($height != 0) {
- $height = (integer)($proportion['proportion_height'] * $height);
- $progress_bar_heigh = $progress_bar_heigh * $proportion['proportion_height'];
- }
- else {
- $height = (integer)($proportion['proportion_height'] * $infoImage[1]);
- }
- }
-
- if($layoutData['label_position']=='up'){
- echo io_safe_output($text);
- }
-
- ob_start();
- if ($type == PERCENTILE_BUBBLE) {
- echo progress_bubble($percentile, $width, $width, '', 1, $value_text, $colorStatus,$imgpos);
+ $percentile = $value_text;
}
else {
- echo progress_bar($percentile, $width, $progress_bar_heigh, '', 1, $value_text, $colorStatus,$imgpos);
+ $unit_text = "%";
}
- $img = ob_get_clean();
if (get_parameter('action') == 'edit') {
if ($width == 0) {
@@ -1466,67 +1438,25 @@ function visual_map_print_item($mode = "read", $layoutData,
}
}
else{
- $img = str_replace('>', 'class="image" style="height:'.$himg.'px;width:'.$wimg.'px;'.$imgpos.'" id="image_' . $id . '" />', $img);
+ $img = d3_progress_bar($id, $percentile, $width, 50, $border_color, $unit_text, $label, $fill_color);
}
- echo $img;
+ echo $img;
- if($layoutData['label_position']=='down'){
- echo io_safe_output($text);
- }
- else if($layoutData['label_position']=='left' || $layoutData['label_position']=='right'){
- echo io_safe_output($text);
- }
-
break;
case PERCENTILE_BUBBLE:
- $imgpos = '';
+ if (($layoutData['image'] == 'value') && ($value_text !== false)) {
+ $unit_text = db_get_sql ('SELECT unit
+ FROM tagente_modulo
+ WHERE id_agente_modulo = ' . $id_module);
+ $unit_text = trim(io_safe_output($unit_text));
- if($layoutData['label_position']=='left'){
- $imgpos = 'float:right;';
- }
- else if($layoutData['label_position']=='right'){
- $imgpos = 'float:left;';
- }
-
- $progress_bar_heigh = 15;
- if (!empty($proportion)) {
- if ($width != 0) {
- $width = (integer)($proportion['proportion_width'] * $width);
- }
- else {
- $width = (integer)($proportion['proportion_width'] * $infoImage[0]);
- }
-
- if ($height != 0) {
- $height = (integer)($proportion['proportion_height'] * $height);
- $progress_bar_heigh = $progress_bar_heigh * $proportion['proportion_height'];
- }
- else {
- $height = (integer)($proportion['proportion_height'] * $infoImage[1]);
- }
- }
-
- if($layoutData['label_position']=='up'){
- echo io_safe_output($text);
- }
-
- ob_start();
- if ($type == PERCENTILE_BUBBLE) {
- if($width == 0){
- echo progress_bubble($percentile, 100,100, '', 1, $value_text, $colorStatus,$s);
-
- }
- else{
- echo progress_bubble($percentile, $width,$width, '', 1, $value_text, $colorStatus);
- }
+ $percentile = $value_text;
}
else {
- echo progress_bar($percentile, $width, $progress_bar_heigh, '', 1, $value_text, $colorStatus);
+ $unit_text = "%";
}
- $img = ob_get_clean();
-
if(get_parameter('action') == 'edit'){
if($width == 0){
$img = '';
@@ -1536,51 +1466,18 @@ function visual_map_print_item($mode = "read", $layoutData,
}
}
else{
- $img = str_replace('>', 'class="image" style="width:'.$wimg.'px;height:'.$himg.'px;'.$imgpos.'" id="image_' . $id . '" />', $img);
+ if($width == 0){
+ $img = d3_progress_bubble($id, $percentile, 200,200, $border_color, $unit_text, $label, $fill_color);
+ }
+ else{
+ $img = d3_progress_bubble($id, $percentile, $width, $width, $border_color, $unit_text, $label, $fill_color);
+ }
}
echo $img;
- if($layoutData['label_position']=='down'){
- echo io_safe_output($text);
- }
- else if($layoutData['label_position']=='left' || $layoutData['label_position']=='right'){
- echo io_safe_output($text);
- }
-
break;
case CIRCULAR_PROGRESS_BAR:
- $imgpos = '';
-
- if($layoutData['label_position']=='left'){
- $imgpos = 'float:right;';
- }
- else if($layoutData['label_position']=='right'){
- $imgpos = 'float:left;';
- }
-
- $progress_bar_heigh = 15;
- if (!empty($proportion)) {
- if ($width != 0) {
- $width = (integer)($proportion['proportion_width'] * $width);
- }
- else {
- $width = (integer)($proportion['proportion_width'] * $infoImage[0]);
- }
-
- if ($height != 0) {
- $height = (integer)($proportion['proportion_height'] * $height);
- $progress_bar_heigh = $progress_bar_heigh * $proportion['proportion_height'];
- }
- else {
- $height = (integer)($proportion['proportion_height'] * $infoImage[1]);
- }
- }
-
- if($layoutData['label_position']=='up'){
- echo io_safe_output($text);
- }
-
if(get_parameter('action') == 'edit'){
if($width == 0){
$img = '
';
@@ -1602,56 +1499,18 @@ function visual_map_print_item($mode = "read", $layoutData,
$unit_text = "%";
}
- if($width < 200){
- $img = progress_circular_bar($id, $percentile, 200,200, $border_color, $unit_text);
+ if($width == 0){
+ $img = progress_circular_bar($id, $percentile, 200,200, $border_color, $unit_text, $label, $fill_color);
}
else{
- $img = progress_circular_bar($id, $percentile, $width, $width, $border_color, $unit_text);
+ $img = progress_circular_bar($id, $percentile, $width, $width, $border_color, $unit_text, $label, $fill_color);
}
}
echo $img;
- if($layoutData['label_position']=='down'){
- echo io_safe_output($text);
- }
- else if($layoutData['label_position']=='left' || $layoutData['label_position']=='right'){
- echo io_safe_output($text);
- }
-
break;
case CIRCULAR_INTERIOR_PROGRESS_BAR:
- $imgpos = '';
-
- if($layoutData['label_position']=='left'){
- $imgpos = 'float:right;';
- }
- else if($layoutData['label_position']=='right'){
- $imgpos = 'float:left;';
- }
-
- $progress_bar_heigh = 15;
- if (!empty($proportion)) {
- if ($width != 0) {
- $width = (integer)($proportion['proportion_width'] * $width);
- }
- else {
- $width = (integer)($proportion['proportion_width'] * $infoImage[0]);
- }
-
- if ($height != 0) {
- $height = (integer)($proportion['proportion_height'] * $height);
- $progress_bar_heigh = $progress_bar_heigh * $proportion['proportion_height'];
- }
- else {
- $height = (integer)($proportion['proportion_height'] * $infoImage[1]);
- }
- }
-
- if($layoutData['label_position']=='up'){
- echo io_safe_output($text);
- }
-
if(get_parameter('action') == 'edit'){
if($width == 0){
$img = '
';
@@ -1673,24 +1532,17 @@ function visual_map_print_item($mode = "read", $layoutData,
$unit_text = "%";
}
- if($width < 200){
- $img = progress_circular_bar_interior($id, $percentile, 200,200, $border_color);
+ if($width == 0){
+ $img = progress_circular_bar_interior($id, $percentile, 200,200, $border_color, $unit_text, $label, $fill_color);
}
else{
- $img = progress_circular_bar_interior($id, $percentile, $width, $width, $border_color);
+ $img = progress_circular_bar_interior($id, $percentile, $width, $width, $border_color, $unit_text, $label, $fill_color);
}
}
echo $img;
- if($layoutData['label_position']=='down'){
- echo io_safe_output($text);
- }
- else if($layoutData['label_position']=='left' || $layoutData['label_position']=='right'){
- echo io_safe_output($text);
- }
-
break;
case MODULE_GRAPH:
if ($layoutData['label_position']=='up') {
diff --git a/pandora_console/include/functions_visual_map_editor.php b/pandora_console/include/functions_visual_map_editor.php
index 49945a30f4..e2736dbf9b 100755
--- a/pandora_console/include/functions_visual_map_editor.php
+++ b/pandora_console/include/functions_visual_map_editor.php
@@ -157,8 +157,6 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
$form_items['label_row'] = array();
$form_items['label_row']['items'] = array('label',
'static_graph',
- 'percentile_bar',
- 'percentile_item',
'module_graph',
'simple_value',
'datos',
@@ -445,14 +443,28 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
$form_items['percentile_item_row_5'] = array();
$form_items['percentile_item_row_5']['items'] = array('percentile_bar', 'percentile_item', 'datos');
- $form_items['percentile_item_row_5']['html'] = '