D3 .bandwidth() returning NaN
问题 I am new to d3. I have been trying to solve this for some time, but I couldn't find any similar issues here. I am trying to create a grouped bar chart (something like https://bl.ocks.org/mbostock/3887051). This is a section of my current code: var width = "100%"; var height = "96vh"; var canvas = d3.select("body") .append('svg') .attr('width',width) .attr('height', height) .style("border", "2px solid black"); var y0 = d3.scaleBand() .paddingInner(0.1) .range([0, height]); var y1 = d3