diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js index 38a1ba1fb9..d4d552f52b 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.js +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js @@ -1515,14 +1515,7 @@ function loadFieldsFromDB(item) { } if (key == 'value_show') { - if (val == 'percent') { - $("input[name=value_show][value=percent]") - .attr("checked", "checked"); - } - else { - $("input[name=value_show][value=value]") - .attr("checked", "checked"); - } + $("select[name=value_show]").val(val); } if (key == 'id_group') { diff --git a/pandora_console/include/ajax/visual_console_builder.ajax.php b/pandora_console/include/ajax/visual_console_builder.ajax.php index ab13300de9..bdd80bcafc 100755 --- a/pandora_console/include/ajax/visual_console_builder.ajax.php +++ b/pandora_console/include/ajax/visual_console_builder.ajax.php @@ -670,11 +670,7 @@ switch ($action) { $values['type'] = PERCENTILE_BUBBLE; } - //Check the field's value for back compatibility - $values['image'] = 'percent'; - if (($value_show == 'percent') || - ($value_show == 'value')) - $values['image'] = $value_show; + $values['image'] = $value_show; $values['border_color'] = $percentile_color; $values['fill_color'] = $percentile_label_color; @@ -842,11 +838,8 @@ switch ($action) { case 'percentile_bar': $elementFields['width_percentile'] = $elementFields['width']; $elementFields['max_percentile'] = $elementFields['height']; - //Check the field's value for back compatibility - $elementFields['value_show'] = 'percent'; - if (($elementFields['image'] == 'percent') || - ($elementFields['image'] == 'value')) - $elementFields['value_show'] = $elementFields['image']; + + $elementFields['value_show'] = $elementFields['image']; $elementFields['type_percentile'] = 'percentile'; if ($elementFields['type'] == PERCENTILE_BAR) { @@ -864,6 +857,7 @@ switch ($action) { $elementFields['percentile_color'] = $elementFields['border_color']; $elementFields['percentile_label_color'] = $elementFields['fill_color']; $elementFields['percentile_label'] = $elementFields['label']; + html_debug($elementFields, true); break; case 'donut_graph': $elementFields['width_percentile'] = $elementFields['width']; diff --git a/pandora_console/include/graphs/pandora.d3.js b/pandora_console/include/graphs/pandora.d3.js index 7c21d859c9..1c2ab88b59 100644 --- a/pandora_console/include/graphs/pandora.d3.js +++ b/pandora_console/include/graphs/pandora.d3.js @@ -1552,7 +1552,7 @@ function progress_bar_d3 (recipient, percentile, width, height, color, unit, lab function updateProgress(bar_progress) { var percent_value = Number(bar_progress * 100); - numberText.text(percent_value.toFixed()); + numberText.text(percent_value.toFixed() + " " + unit); progress_front.attr('width', (width * bar_progress)); } @@ -1657,11 +1657,11 @@ function progress_bubble_d3 (recipient, percentile, width, height, color, unit, .style("font-weight", "bold") .style("font-size", numberSize) .attr('text-anchor', 'middle') - .attr('dy', width/2); + .attr('dy', width/3); function updateProgress(bar_progress) { var percent_value = Number(bar_progress * 100); - numberText.text(percent_value.toFixed() + " %"); + numberText.text(percent_value.toFixed() + " " + unit); progress_front.attr('r', ((width/2) * bar_progress)); }