扫码关注官方订阅号
初学D3.js 在学习坐标的地方遇到一些问题
代码:
var mom = d3.scale.linear().domain([0, d3.max(dataset)]).range([0, 250]);
提示及错误是:
Cannot read property 'linear' of undefined
人生最曼妙的风景,竟是内心的淡定与从容!
我之前也碰到这种情况,原因是d3的引用地址错了,改为http://d3js.org/d3.v3.min.js后不再报错
4.0版本应该使用scaleLinear()方法,这是3.0中的表示方法。
参考: https://github.com/d3/d3/blob/master/CHANGES.md
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
我之前也碰到这种情况,原因是d3的引用地址错了,改为http://d3js.org/d3.v3.min.js后不再报错
4.0版本应该使用scaleLinear()方法,这是3.0中的表示方法。
参考: https://github.com/d3/d3/blob/master/CHANGES.md