difference between function(d) and function(d,i)?

前端 未结 3 1052
夕颜
夕颜 2021-02-01 22:36

Every D3js beginner must be going through this thought, I am pretty much sure about it.

I have been around this thing for few hours now!!!!But I don\'t

3条回答
  •  别跟我提以往
    2021-02-01 23:23

    I hope that this example can help you. This is a complete web page where you can start playing:

    
    
    my first d3
    
    
    
    

    Basically d is the value of the data, and i is his index. You can take a look of this example here: http://jsfiddle.net/M8nK8/

提交回复
热议问题