d3.js - d3 updating multiple svgs -
i create multiple (2) svgs on page , trying update them.
$('#records li ').click(function() { var id = event.target.id; var idparts = id.split("_"); var numrec = idparts[1]; $.get('php/connection2.php', { numrecs: numrec}, function(data) { var obj = json.parse(data); var numericarray = createdata(obj); var length = numericarray.length; var svgs = d3.selectall('svg'); (var = 0; < length; i++) { svgs[0][i].attr("_data_",numericarray[i]); } return false; }); });
i know isnt correct:
svgs[0][i].attr("_data_",numericarray[i]);
attached ss entering loop
edit:this part of loop create each svg.
var svg = d3.select("#content").append("div").attr("class","datadiv").attr("id",mydata[i]+"_div").style("float","left").selectall("svg") .data(thisdata) .enter().append("svg") .attr("class", "box") .attr("width", width + margin.left + margin.right) .attr("height", height + margin.bottom + margin.top) .append("g") .attr("transform", "translate(" + margin.left + "," + margin.top + ")") .call(chart)
any appreciated.
Comments
Post a Comment