Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

d3.scaleBand not a function

Shouldn't it work with this library? <script src="https://d3js.org/d3.v4.js"> I've tried all the libraries that I can find about this and none of them get rid of this error. Any help would be great.

var x = d3.scaleBand().rangeRound([10, width]).padding(0.4),
    y = d3.scaleLinear().rangeRound([height, 20]);
like image 776
7rystan Avatar asked Mar 26 '26 17:03

7rystan


1 Answers

Instead of

var x = d3.scaleBand().rangeRound([10, width]).padding(0.4),
y = d3.scaleLinear().rangeRound([height, 20]);

Change .padding to .paddingInner like such

var x = d3.scaleBand().rangeRound([10, width]).paddingInner(0.4),
y = d3.scaleLinear().rangeRound([height, 20]);

Thanks to Darren Sweeney for the answer.

like image 156
7rystan Avatar answered Mar 28 '26 07:03

7rystan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!