javascript - Issue with speedometer highcharts dynamically update guage range -
i have use case need modify guage range dynamically, when highcharts graph behaves weirdly , range goes out of bounds. please @ image below
this happens after 7th iteration (value 0.007)
. can find code on jsfiddle @ http://jsfiddle.net/s6ltl/
my highcharts speedometer code (jsfiddle)
can me how resolve issue?
on each iteration, adding new plotband, not removing old ones:
chart.yaxis[0].removeplotband('red'); chart.yaxis[0].removeplotband('green'); chart.yaxis[0].addplotband({ id: 'red', from: newval - 0.005, to: newval - 0.001, color: '#df5353' // red }); chart.yaxis[0].addplotband({ id: 'green', from: newval - 0.001, to: newval + 0.005, color: '#55bf3b' //green });
updated fiddle.
Comments
Post a Comment