Fixed Y-axis label decimals
This commit is contained in:
parent
bc251e58df
commit
4d78256937
|
@ -1930,6 +1930,8 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
|
|||
}
|
||||
}
|
||||
|
||||
// Get only two decimals
|
||||
formatted =round_with_decimals(formatted, 100)
|
||||
return '<div class='+font+' style="font-size:'+font_size+'pt;">'+formatted+'</div>';
|
||||
}
|
||||
|
||||
|
|
|
@ -1494,14 +1494,6 @@ function print_phases_donut (recipient, phases) {
|
|||
}
|
||||
}
|
||||
|
||||
function round_with_decimals (value, multiplier = 1) {
|
||||
if ((value * multiplier) == 0) return 0;
|
||||
if ((value * multiplier) >= 1) {
|
||||
return Math.round(value * multiplier) / multiplier;
|
||||
}
|
||||
return round_with_decimals (value, multiplier * 10);
|
||||
}
|
||||
|
||||
function progress_bar_d3 (recipient, percentile, width, height, color, unit, label, label_color) {
|
||||
var startPercent = 0;
|
||||
var endPercent = parseInt(percentile) / 100;
|
||||
|
|
|
@ -1552,3 +1552,11 @@ function paint_graph_status(min_w, max_w, min_c, max_c, inverse_w, inverse_c, er
|
|||
|
||||
}
|
||||
}
|
||||
|
||||
function round_with_decimals (value, multiplier = 1) {
|
||||
if ((value * multiplier) == 0) return 0;
|
||||
if ((value * multiplier) >= 1) {
|
||||
return Math.round(value * multiplier) / multiplier;
|
||||
}
|
||||
return round_with_decimals (value, multiplier * 10);
|
||||
}
|
Loading…
Reference in New Issue