title: Making a grouped bar chart when my groups are varied sizes?
body: <p>I am trying to make a bar chart out of some grouped data. This is dummy data, but the structure is basically the same. The data: <a href="https://gist.githubusercontent.com/amandabee/edf73bc0bbe131435c952f5ed47524a6/raw/99febb9971f76e36af06f1b99913fcaa645ecb3e/election.csv" rel="nofollow">election results</a> includes a bunch of candidates, organized into the districts they were running in, and the total vote count: </p>
  
  <pre><code>district,candidate,votes
  Dist 1,Leticia Putte,3580
  Dist 2,David Barron,1620
  Dist 2,John Higginson,339
  Dist 2,Walter Bannister,2866
  [...]
  </code></pre>
  
  <p>I'd like to create a bar or column chart (either, honestly, though my end goal is horizontal) that groups the candidates by district. </p>
  
  <p>Mike Bostock has an <a href="http://bl.ocks.org/mbostock/3887051" rel="nofollow">excellent demo</a> but I'm having trouble translating it intelligently for my purposes. I started to tease it out at <a href="https://jsfiddle.net/97ur6cwt/6/" rel="nofollow">https://jsfiddle.net/97ur6cwt/6/</a> but my data is organized somewhat differently -- instead of rows, by group, I have a column that sets the category. And there might be just one candidate or there might be a few candidates. </p>
  
  <p>Can I group items if the groups aren't the same size? </p>