score:1

There is a lot of missing element in your code. The selection is not defined. You have to call the data function with data. There must be an enter section with append.

I created a fiddle with some made up parameter from your code. It works more or less.

var data =[1];

 var sel = d3.select("svg")
   .selectAll("rect")
   .data(data)
   .enter()
   .append("rect")
     .attr("width",10)
     .attr("height",40)
     .attr('x', 1.5)
     .attr('y', 1.5)
     .transition().duration(500)
       .attr("width", function(d) { return wScale(Math.abs(d))});

http://jsfiddle.net/acerola/symcuccm/


Related Query

More Query from same tag