       k++
 
   buildGraph: ->
-    graphHeight = $(@element).height()
-    graphWidth = $(@element).width()
-    ch = Math.max(graphHeight, @offsetY + @unitTime * @mtime + 150)
-    cw = Math.max(graphWidth, @offsetX + @unitSpace * @mspace + 300)
-    @r = r = Raphael(@element.get(0), cw, ch)
-    top = r.set()
+    r = @r
     cuday = 0
     cumonth = ""
-    barHeight = Math.max(graphHeight, @unitTime * @days.length + 320)
-
-    r.rect(0, 0, 26, barHeight).attr fill: "#222"
-    r.rect(26, 0, 20, barHeight).attr fill: "#444"
+
+    r.rect(0, 0, 26, @barHeight).attr fill: "#222"
+    r.rect(26, 0, 20, @barHeight).attr fill: "#444"
 
     for day, mm in @days
       if cuday isnt day[0]

        element.scrollLeft element.scrollLeft() + 50  if event.keyCode is 39
        # bottom
        element.scrollTop element.scrollTop() + 50  if event.keyCode is 40

  appendLabel: (x, y, refs) ->
    r = @r
    shortrefs = refs
    # Truncate if longer than 15 chars
    shortrefs = shortrefs.substr(0, 15) + "…"  if shortrefs.length > 17
    text = r.text(x + 4, y, shortrefs).attr(
      "text-anchor": "start"
      font: "10px Monaco, monospace"
      fill: "#FFF"
      title: refs
    )
    textbox = text.getBBox()
    # Create rectangle based on the size of the textbox

    # Set text to front
    text.toFront()

  appendAnchor: (x, y, commit) ->
    r = @r
    top = @top
    options = @options
    anchor = r.circle(x, y, 10).attr(
      fill: "#000"
