Fixed problems with unit
This commit is contained in:
parent
3763a1a93c
commit
31577a823c
|
@ -1515,14 +1515,7 @@ function loadFieldsFromDB(item) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (key == 'value_show') {
|
if (key == 'value_show') {
|
||||||
if (val == 'percent') {
|
$("select[name=value_show]").val(val);
|
||||||
$("input[name=value_show][value=percent]")
|
|
||||||
.attr("checked", "checked");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$("input[name=value_show][value=value]")
|
|
||||||
.attr("checked", "checked");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (key == 'id_group') {
|
if (key == 'id_group') {
|
||||||
|
|
|
@ -670,11 +670,7 @@ switch ($action) {
|
||||||
$values['type'] = PERCENTILE_BUBBLE;
|
$values['type'] = PERCENTILE_BUBBLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Check the field's value for back compatibility
|
$values['image'] = $value_show;
|
||||||
$values['image'] = 'percent';
|
|
||||||
if (($value_show == 'percent') ||
|
|
||||||
($value_show == 'value'))
|
|
||||||
$values['image'] = $value_show;
|
|
||||||
|
|
||||||
$values['border_color'] = $percentile_color;
|
$values['border_color'] = $percentile_color;
|
||||||
$values['fill_color'] = $percentile_label_color;
|
$values['fill_color'] = $percentile_label_color;
|
||||||
|
@ -842,11 +838,8 @@ switch ($action) {
|
||||||
case 'percentile_bar':
|
case 'percentile_bar':
|
||||||
$elementFields['width_percentile'] = $elementFields['width'];
|
$elementFields['width_percentile'] = $elementFields['width'];
|
||||||
$elementFields['max_percentile'] = $elementFields['height'];
|
$elementFields['max_percentile'] = $elementFields['height'];
|
||||||
//Check the field's value for back compatibility
|
|
||||||
$elementFields['value_show'] = 'percent';
|
$elementFields['value_show'] = $elementFields['image'];
|
||||||
if (($elementFields['image'] == 'percent') ||
|
|
||||||
($elementFields['image'] == 'value'))
|
|
||||||
$elementFields['value_show'] = $elementFields['image'];
|
|
||||||
|
|
||||||
$elementFields['type_percentile'] = 'percentile';
|
$elementFields['type_percentile'] = 'percentile';
|
||||||
if ($elementFields['type'] == PERCENTILE_BAR) {
|
if ($elementFields['type'] == PERCENTILE_BAR) {
|
||||||
|
@ -864,6 +857,7 @@ switch ($action) {
|
||||||
$elementFields['percentile_color'] = $elementFields['border_color'];
|
$elementFields['percentile_color'] = $elementFields['border_color'];
|
||||||
$elementFields['percentile_label_color'] = $elementFields['fill_color'];
|
$elementFields['percentile_label_color'] = $elementFields['fill_color'];
|
||||||
$elementFields['percentile_label'] = $elementFields['label'];
|
$elementFields['percentile_label'] = $elementFields['label'];
|
||||||
|
html_debug($elementFields, true);
|
||||||
break;
|
break;
|
||||||
case 'donut_graph':
|
case 'donut_graph':
|
||||||
$elementFields['width_percentile'] = $elementFields['width'];
|
$elementFields['width_percentile'] = $elementFields['width'];
|
||||||
|
|
|
@ -1552,7 +1552,7 @@ function progress_bar_d3 (recipient, percentile, width, height, color, unit, lab
|
||||||
|
|
||||||
function updateProgress(bar_progress) {
|
function updateProgress(bar_progress) {
|
||||||
var percent_value = Number(bar_progress * 100);
|
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));
|
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-weight", "bold")
|
||||||
.style("font-size", numberSize)
|
.style("font-size", numberSize)
|
||||||
.attr('text-anchor', 'middle')
|
.attr('text-anchor', 'middle')
|
||||||
.attr('dy', width/2);
|
.attr('dy', width/3);
|
||||||
|
|
||||||
function updateProgress(bar_progress) {
|
function updateProgress(bar_progress) {
|
||||||
var percent_value = Number(bar_progress * 100);
|
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));
|
progress_front.attr('r', ((width/2) * bar_progress));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue