title: d3.js-v4 stacked bars chart
body: <p>I have a problem with creating stacked bar chart.</p>
  
  <p>I made the following example and it's fine
  <a href="http://bl.ocks.org/mbostock/3886208" rel="nofollow">http://bl.ocks.org/mbostock/3886208</a></p>
  
  <p>But now I have other data format: <em>(this is short example of my data)</em></p>
  
  <pre><code>var data = [
    {
      "PERIOD": 2014001,
      "SUBMITTER": "oanikit2",
      "distr_count": 16
    },
    {
      "PERIOD": 2014001,
      "SUBMITTER": "nvlodavs",
      "distr_count": 21
    },
    {
      "PERIOD": 2014001,
      "SUBMITTER": "manufrie",
      "distr_count": 39
    },
    {
      "PERIOD": 2014001,
      "SUBMITTER": "mtalyshi",
      "distr_count": 14
    }
  ]
  </code></pre>
  
  <p>using nested I converted it into: <em>(short data example below)</em></p>
  
  <pre><code> var nested = d3.nest().key(function (d){return d.SUBMITTER}).entries(data);
      d3.select("body").append("pre").text(JSON.stringify(nested,null,2)); //just to render data on page 
  
  [
    {
      "key": "oanikit2",
      "values": [
        {
          "PERIOD": 2014001,
          "SUBMITTER": "oanikit2",
          "distr_count": 16
        },
        {
          "PERIOD": 2014002,
          "SUBMITTER": "oanikit2",
          "distr_count": 18
        }
      ]
    },
    {
      "key": "nvlodavs",
      "values": [
        {
          "PERIOD": 2014001,
          "SUBMITTER": "nvlodavs",
          "distr_count": 21
        },
        {
          "PERIOD": 2014002,
          "SUBMITTER": "nvlodavs",
          "distr_count": 24
        }
      ]
    }
  ]
  </code></pre>
  
  <p>but have no idea how to move further. How to get y0 values?
  need series on PERIOD and stacked SUBMITTER with distr_count as values.</p>
  
  <p>Tried to follow other examples of stacked bars,
  but all of them about v3. I'm new in D3 so I decided to start with v4 from the beginning. But there is too little examples online.</p>
  
  <p>Maybe you have more examples (links) how to use D3 v4 (stacked bars)? </p>
  
  <p>p.s. also  posted to google questions (can't give a link because of my reputation)</p>