title: Transition from x-axis:Bar Chart
body: <p>I need transition from x-axis(From bottom to top). But now I am getting the bar transition from top to bottom. I have used d3.js and Json object  for the same. </p>
  
  <p>Js Code is as follows:</p>
  
  <pre><code>var margin = {top: 20, right: 20, bottom: 30, left: 40},
      width = 600 - margin.left - margin.right,
      height = 400 - margin.top - margin.bottom;
  
  var x = d3.scale.ordinal()
      .rangeRoundBands([0, width], .6);
  
  var y = d3.scale.linear()
      .range([height, 0]);
  
  var xAxis = d3.svg.axis()
      .scale(x)
      .orient("bottom");
  
  var yAxis = d3.svg.axis()
      .scale(y)
      .orient("left")
      .ticks(10);
  
  var svgBar = 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.json", function(error, data) {
      function type(d) {
    d.Speed = +d.Speed;
  }
    x.domain(data.map(function(d) { return d.Days; }));
    y.domain([0, d3.max(data, function(d) { return d.Speed; })]);
    svgBar.append("g")
        .attr("class", "x axis")
        .attr("transform", "translate(0," + height + ")")
        .call(xAxis);
  
    svgBar.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("Speed");
  
    var graphTransition = svgBar.selectAll("bar")
        .data(data)
        .enter().append("rect")
        .attr("class", "bar")
        .attr("x", function(d) { return x(d.Days); })
        .attr("width", x.rangeBand())
        .attr("y", function(d) { return y(d.Speed); })
        .attr("height",0);// Initial Height at loading
  
      graphTransition
      .transition()
      .attr("height", function(d) { return height - y(d.Speed); }) //Bar height after transition
      .duration(1000);
  
  });
  </code></pre>
  
  <p>Json is as follows:</p>
  
  <pre><code>[
  
       {"Days":"Mon","Speed":150},
      {"Days":"Tue","Speed":200}
  
  ]
  </code></pre>
  
  <p>There may be a silly thing I have missed out from my end. Any help is appreciated and Thanks in advance. </p>