2015年3月6日 星期五

d3.js : array function

we have to use i,d as parameters
data is one of the property of 

var theData = [ 1, 2, 3 ]

var p = d3.select("body").selectAll("p")
  .data(theData)
  .enter()
  .append("p")
  .text(function (d,i) {
    return "i = " + i + " d = "+d;
});
Viewing index and datum variables in D3.js operator






沒有留言:

張貼留言