Accepted answer

In D3 v4 it is no longer named d3.scale.linear(). Use d3.scaleLinear() instead.


Thanks for the answer, I've solved this error for the following code (I'm studing D3.js) :

var colorScale = d3.scale.linear().domain([0, 100]).range(["#add8e6", "blue"]);

With the following error (inside the web page) :

Uncaught TypeError: Cannot read property 'linear' of undefined at index.html:22

Related Query