Reputation: 1584
I need some help with getting the replot method to work.
I have a simple script and it simply doesn't update the needle. I've 'dumbed' it down to be all hard coded to change from onload of '1' to an update of '3'. the update doesn't change the meter.
$(function(){
var usageplot = $.jqplot('usagemeter',[[1]],{ OPTIONS THAT DONT MATTER} });
function networkrefresh() {
usageplot.data=[[3]];
usageplot.replot();
}
var gn = setInterval(networkrefresh,2000);
}
and the
<div id="usagemeter"></div>
markup
it renders the 1 value corectly, networkrefresh updates 2 seconds later. but i don't get the redraw. it remains at 1.
what am i missing?
Upvotes: 0
Views: 369
Reputation: 1584
I was able to find another user with a similar issue and an answer: reuse jqplot object to load or replot data
need to shove the series value in like:
usageplot.replot({data:[[3]]});
in the replot call instead of in the data call itself.
Upvotes: 1