javascript - Plot dynamic Nvd3 chart without reinitialising? -
i'm creating pie chart:
var chart = nv.models.piechart() .x(function(d) { return d.key; }) .y(function(d) { return d.value; }) .valueformat(d3.format(',d')) .labelsoutside(true) .showlabels(true);
and i'm retrieving data repeatedly via ajax , updating chart:
(function loop() { d3.json(url, function(data) { d3.select('#chart svg').datum(data).call(chart); }); settimeout(loop, 2000); })();
however, if uncheck 1 of values in legend remove entry reappears @ next timer refresh, causing slice reappear.
is there way refresh data without causing reinitialise? i've tried using .data
instead of .datum
no avail.
Comments
Post a Comment