     @dataXMin = @canvasGraph.toDataXCoord(@canvasXMin)
     @dataXMax = @canvasGraph.toDataXCoord(@canvasXMax)
 
-  updateCursor: (e) ->
+  updateCursor: (e) =>
     if @pointerYInElement(e) < 15
       @element.style.cursor = "pointer"
     else if ((Math.abs @pointerXInElement(e) - (@canvasXMax-@canvasXMin)) < 10) || @pointerXInElement(e) < 10

    if (@ in @canvasGraph.marks.all) then @canvasGraph.marks.update(@) else @canvasGraph.marks.add(@)
    @dragging = false
    @moving = false

  toCanvasXPoint: (e) -> e.pageX-@canvas.getBoundingClientRect().left - window.scrollX

  pointerXInElement: (e) -> e.offsetX || e.clientX - e.target.offsetLeft + window.pageXOffset - @canvas.getBoundingClientRect().left


      @moving = true
      @pointerOffset = (@toCanvasXPoint(e) - @canvasXMin)

  onMouseUp: (e) =>
    e.preventDefault()
    for mark in @canvasGraph.marks.all
      mark.dragging = false
