       bdcgraph.select '*'
       .remove()
 
-      margin = {top: 20, right: 20, bottom: 30, left: 50}
-      width = 960 - margin.left - margin.right
-      height = 500 - margin.top - margin.bottom
-
       # I recommend using a linear scale and computing the day number
-      x = d3.time.scale().range([0, width])
-      y = d3.scale.linear().range([height, 0])
+      x = d3.time.scale().range([0, cfg.width])
+      y = d3.scale.linear().range([cfg.height, 0])
 
       standardLine = d3.svg.line()
       .x (d, i) -> x(i)

        margins:
          top: 20
          right: 70
          bottom: 20
          left: 50
        tickSize: 5
        color:

      .scale(y)
      .orient("left")
      # display horizontal grids
      .innerTickSize(-cfg.width)
      .outerTickSize(0)

      chart = bdcgraph.append("svg")
      .attr("class", "chart")
      .attr("width", cfg.width + cfg.margins.left + cfg.margins.right)
      .attr("height", cfg.height + cfg.margins.top + cfg.margins.bottom)
      .append("g")
      .attr("transform", "translate(" + cfg.margins.left + "," + cfg.margins.top + ")")

      # define the shape of an arrowhead
      chart.append("defs").append("marker")
