Javascript 如何根据protovis js中的数据上下文创建布局元素?

Javascript 如何根据protovis js中的数据上下文创建布局元素?,javascript,protovis,Javascript,Protovis,我看到这一点,不禁想知道如何创建如下元素: bg.add(pv.Wedge) .angle(smallAngle) .startAngle(function(d) this.proto.startAngle() + smallAngle) .outerRadius(function(d) radius(d.penicillin)) .fillStyle(drugColor.Penicillin) 只有当d.peni

我看到这一点,不禁想知道如何创建如下元素:

bg.add(pv.Wedge)
          .angle(smallAngle)
          .startAngle(function(d) this.proto.startAngle() + smallAngle)
          .outerRadius(function(d) radius(d.penicillin))
          .fillStyle(drugColor.Penicillin)
只有当
d.penicillin>0
时,才调用
bg.add(pv.Wedge)
(因此根据数据,而不仅仅是其参数,有更多或更少的ui元素)