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 ="svg")
     .attr('x', 1.5)
     .attr('y', 1.5)
       .attr("width", function(d) { return wScale(Math.abs(d))});

Related Query

More Query from same tag