【发布时间】:2016-12-12 14:27:30
【问题描述】:
我正在尝试从 nv.d3.js 渲染箱线图。 v.1.8.5 和 d3.js v.3.4.4 。我在 index.html 的 nv.d3.js 文件之前添加 d3.js 文件。代码中断说 boxplots.watchTransition is not a function
以下是我的代码
d3.selection.prototype.watchTransition = function(renderWatch){
var args = [this].concat([].slice.call(arguments, 1));
return renderWatch.transition.apply(renderWatch, args);
};
以及后面的代码
boxplots.watchTransition(renderWatch, 'nv-boxplot: boxplots')
.style('stroke-opacity', 1)
.style('fill-opacity', 0.75)
.delay(function(d,i) { return i * duration / data.length })
.attr('transform', function(d,i) {
return 'translate(' + (xScale(getX(d,i)) + xScale.rangeBand() * 0.05) + ', 0)';
});
【问题讨论】:
标签: angularjs d3.js nvd3.js boxplot