title: Bar chart with negative values
body: <p>I need to create a d3 bar chart that can have negative values. Ideally the axis zero position should be calculated based on the extent of the data, but I'd settle for a solution that assumes symmetric positive and negative extent, i.e. that it would be always in the middle of the chart.</p>
  
  <p>Here's an example of what I'd like to achieve.</p>
  
  <p><img src="https://i.stack.imgur.com/SB3uh.png" alt="Bar chart with negative values"></p>