         @ctx.fillStyle = textColor
         @ctx.fillText(i,tick_x,tickMajorLength+5)
 
+        tick_x = ((+i - xMin) / (xMax - xMin)) * @canvas.width
+        @ctx.font = '10pt Arial'
+        @ctx.textAlign = 'center'
+        @ctx.fillStyle = textColor
+        @ctx.fillText( i, tick_x, @canvas.height - tickMajorLength+5 )
+
     for i in [0...@dataLength]
       x = ((+@data.x[i] - xMin) / (xMax - xMin)) * @canvas.width
       # y = ((+@data.y[i] - @largestY) / (@smallestY - @largestY)) * @canvas.height
       y = +@data.y[i] * @canvas.height# - @canvas.height
+      y=-y+@canvas.height
       @ctx.fillStyle = "#fff"
       @ctx.fillRect(x,y,2,2)
 

        @ctx.strokeStyle = tickColor
        @ctx.stroke()

      if i % tickMajorInterval is 0 and i isnt 0
        tick_x = ((+i - xMin) / (xMax - xMin)) * @canvas.width
        @ctx.font = '10pt Arial'


    @dataLength = Math.min @data.x.length, @data.y.length

    # @data_orig = []
    for xValue, idx in [@data.x...]
      # @data_orig[idx] = @data.x[idx]
      @data.x[idx] = xValue - @smallestX

    # normalize data
