6
我在d3中創建對數刻度時遇到了問題。如果設置爲線性,則標尺運行正常。對數刻度返回NaN
這工作:
var myLinScale = d3.scale.linear()
.domain([0, 100])
.range([50, 1150]);
console.log(myLinScale(71)); //output = 831
然而,這不起作用:
var myLogScale = d3.scale.log()
.domain([0, 100])
.range([50, 1150]);
console.log(myLogScale(71)); //output = NaN
什麼是錯的對數刻度?