d3以下几个方法的功能是什么
本文介绍了d3以下几个方法的功能是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问 题
var chart = d3.bullet()
.width(width)
.height(height);
var svg = d3.selectAll("svg")
.data(fdata)//fdata 含个元素
.enter().append("svg")
.attr("class", "bullet")
.attr("width", width + margin.left + margin.right)
.attr("height", height + margin.top + margin.bottom)
.attr("y",function(d, idx){
console.log(d);//d只输出来后三个元素,什么原因?
return bulletHeight * idx;
})
.append("g")
.attr("transform", "translate(" + margin.left + "," + margin.top + ")")
.call(chart);
求大手给解释下各个方法都是什么意思? 还有数组元素个数为什么会少了前2个?
解决方案
这篇关于d3以下几个方法的功能是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文