问题描述:

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]);

网友答案:

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.

相关阅读:
Top