1
我試圖呈現從nv.d3.js.箱線圖功能v.1.8.5和d3.js v.3.4.4。我加入d3.js文件在index.html .The代碼休息nv.d3.js文件之前說boxplots.watchTransition is not a function
watchTransition()不nv.d3.js與angular.js
以下是我的代碼
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)';
});