javascript - Set the bubble color on a bubble chart based on the value -
javascript - Set the bubble color on a bubble chart based on the value -
i have set colors of each bubble on bubble chart based on number have on array. thing know is:
if value equal 3, color has "#a68500" if value equal 0, color has "#fff79b"so, if 1 element of array has value "2.5" have find color represents number in color scale.
i'm using dojox.charting, have no thought how create function that, based on value, returns color.
any thought helpful!!!!
function getinterpolation(x, min1, max1, min2, max2) { homecoming math.round(x/(max1-min1)*(max2-min2)+min2); }
use getinterpolation(2.5, 0, 3, 0xff, 0xa6);
each rgb component. if utilize in loop can alter min , max const values.
javascript
Comments
Post a Comment