title: bar graph does not render d3
body: <p>I have activity tracking data I want to plot with a bar graph. Why does my bar graph don't render the rects? I can't see the mistake i made. I think I got the data structure right but I can't check at all. The data is provided with this <a href="https://gist.github.com/anonymous/5b5dd1c6f31cfe8a82f235865ce3e478" rel="nofollow">GitHub gist</a>.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;meta charset="utf-8"&gt;
  
  &lt;svg class="chart"&gt;&lt;/svg&gt;
  &lt;script src="//d3js.org/d3.v3.min.js" charset="utf-8"&gt;&lt;/script&gt;
  
  &lt;script&gt;
    var margin = {
        top: 20,
        right: 20,
        bottom: 70,
        left: 40
      },
      width = 900 - margin.left - margin.right,
      height = 700 - margin.top - margin.bottom;
  
  
  
    var parseDate = d3.time.format("%H:%M:%S").parse;
    var x = d3.time.scale().range([0, width]);
  
    var y = d3.scale.linear().range([height, 0]);
  
    var xAxis = d3.svg.axis()
      .scale(x)
      .orient("bottom")
      //.tickFormat(d3.time.format("%H:%M:%S"));
  
    var yAxis = d3.svg.axis()
      .scale(y)
      .orient("left")
      .ticks(10);
  
    var svg = d3.select("body").append("svg")
      .attr("width", width + margin.left + margin.right)
      .attr("height", height + margin.top + margin.bottom)
      .append("g")
      .attr("transform",
        "translate(" + margin.left + "," + margin.top + ")");
  
  
    d3.json("data/testdata.json", function(data) {
  
  
  
      x.domain(d3.extent(data.dataset, function(d) {
        return parseDate(d.time);
      }));
      // x.domain(d3.map(data.dataset, function(d) {
      //   console.log(d.time);
      //     return parseDate(d.time)
      // }));
      // y.domain(d3.extent(data, function(d, i) {
      //     return d.dataset[i].steps;
      // }));
      y.domain([0, d3.max(data.dataset, function(d) {
        return d.steps;
      })]);
  
      svg.append("g")
        .attr("class", "x axis")
        .attr("transform", "translate(0," + height + ")")
        .call(xAxis)
        .selectAll("text")
        .style("text-anchor", "end")
        // .text("Time")
        .attr("dx", "-.8em")
        .attr("dy", "-.55em")
        .attr("transform", "rotate(-90)");
  
      svg.append("g")
        .attr("class", "y axis")
        .call(yAxis)
        .append("text")
        .attr("transform", "rotate(-90)")
        .attr("y", 6)
        .attr("dy", ".71em")
        .style("text-anchor", "end")
        .text("Steps");
  
      svg.selectAll("bar")
        .data(data)
        .enter().append("rect")
        .style("fill", "steelblue")
        .attr("class", "bar")
        .attr("x", function(d, i) {
          return x(parseDate(d.dataset[i].time));
        })
        .attr("y", function(d, i) {
          return y(d.dataset[i].steps);
        })
        .attr("width", function(d) {
          return width / d.dataset.length
        })
        .attr("height", function(d, i) {
          return height - y(d.dataset[i].steps);
        });
  
    });
  &lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Can you give me a hint? Do I have to nest/structure my json in another way? It must be basic but somehow I don't get the bar graphs</p>