我正在尝试使用d3js.org提供的Donut3D.js。但是,我对以下内容感到困惑
Donut3D.transition(“ salesDonut”,randomData(),130,100,30,0.4);
收尾号码代表什么?
130、100、30、0.4
我没有看到任何文档吗?有人可以帮助我了解正在传递的数字。
var salesData=[
{label:"Used", color:"#FF3300"},
{label:"Free", color:"#00FF00"}
];
var svg = d3.select("body").append("svg").attr("width",700).attr("height",300);
svg.append("g").attr("id","salesDonut");
Donut3D.draw("salesDonut", randomData(), 150, 150, 130, 100, 30, 0.4);
function changeData(){
Donut3D.transition("salesDonut", randomData(), 130, 100, 30, 0.4);
}
function randomData(){
return salesData.map(function(d){
return {label:d.label, value:1000*Math.random(), color:d.color};});
}
</script>
Donut3D定义就在页面及其绘制方法中
Donut3D.draw=function(id, data, x /*center x*/, y/*center y*/,
rx/*radius x*/, ry/*radius y*/, h/*height*/, ir/*inner radius*/)
在那里,您可以看到每个值代表什么
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句