gpt4 book ai didi

javascript - Jshint : error : d3 is not defined

转载 作者:行者123 更新时间:2023-11-30 11:37:19 26 4
gpt4 key购买 nike

我在我的应用程序中使用了 angular-nvd3。运行 jshint 任务时,显示错误:d3 is not defiend。

这是我使用 d3 的 Controller :

        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 !!!");
}
}
}

最佳答案

检查你的 .jshintrc 文件

如果“d3”定义在全局变量下

 "globals": {
"d3": true
}

关于javascript - Jshint : error : d3 is not defined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43914484/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com