Hey guys i have a formula the percentage of cals_in vs cals_out (out of 200%)
i created a scale to show the difference in the values in terms of percentage. The problem is I wanna convert the difference in terms of pixels height to move the scale up or down
function setScalesToValue(fValue) {
document.getElementById("cals_in").style.bottom = (183 + fValue) + "px";
document.getElementById("cals_out").style.bottom = (183 - fValue) + "px";
}
The initial scale position is 183, then the diff is then added or subtracted to show the projections on the scale. It's not working too well and I'm seeking anyone's help to use the return percentage to move the scale
NB: the fValue cannot be more than 20px.
Any guidance will b appreciated.