 
 labelPadding = (vars) ->
 
+  xDomain = vars.x.scale.viz.domain()
+  yDomain = vars.y.scale.viz.domain()
+
   # Calculate Y axis padding
   yAttrs =
     "font-size":   vars.y.ticks.font.size+"px"

          d * 100 + "%"
        else if d.constructor is Date
          vars.data.time.multiFormat(d)
        else
          10 + " " + formatPower Math.round(Math.log(d) / Math.LN10)
      else
        null


  xAxisHeight              = Math.round xAxisHeight
  xAxisWidth               = Math.round xAxisWidth
  vars.axes.margin.bottom += xAxisHeight
  lastTick = vars.x.ticks.values[vars.x.ticks.values.length - 1]
  rightLabel = vars.x.scale.viz lastTick
  rightPadding = vars.axes.width - rightLabel
  if rightPadding < xAxisWidth
    vars.axes.width -= (xAxisWidth/2 - rightPadding)

  vars.axes.height -= (vars.axes.margin.top + vars.axes.margin.bottom)

  vars.x.scale.viz.range buckets([0,vars.axes.width], xDomain.length)
  vars.y.scale.viz.range buckets([0,vars.axes.height], yDomain.length)

createAxis = (vars, axis) ->
