【发布时间】:2017-05-11 11:43:10
【问题描述】:
我在我的应用程序中使用 angular-nvd3。在运行 jshint 任务时,它显示错误:d3 is not defiend。
这是我使用 d3 的控制器:
function measurementsCtrl() {
var vm = this;
vm.options = {
chart: {
type: 'lineChart',
height: 450,
margin : {
top: 20,
right: 20,
bottom: 40,
left: 55
},
x: function(d){ return d.x; },
y: function(d){ return d.y; },
xAxis: {
axisLabel: 'Time (ms)'
},
yAxis: {
axisLabel: 'Voltage (v)',
tickFormat: function(d){
return d3.format('.02f')(d);
},
axisLabelDistance: -10
},
callback: function(chart){
console.log("!!! lineChart callback !!!");
}
}
}
【问题讨论】:
标签: javascript angularjs d3.js nvd3.js