title: D3.js: xScale.bandwith is not a function
body: <p>I'm newbie with d3.js and I want to make a bar chart but I've got a problem when I try to draw the bars because I've got an error on line 62.</p>
  
  <p>I don't know why it gives an error when inside the same function I make a consult and I've got the value which is returned by xScale.bandwith but not inside an attr.</p>
  
  <p>Please, check this code:</p>
  
  <p><a href="https://codesandbox.io/s/single-bar-chart-kenmq?fontsize=14&amp;hidenavigation=1&amp;theme=dark" rel="nofollow noreferrer"><img src="https://codesandbox.io/static/img/play-codesandbox.svg" alt="Edit single bar chart"></a></p>
  
  <p>Why it happend? Am I doing something wrong?</p>