Merge pull request #460 from JelteF/horizontal-bar-fixes

Fix transX
This commit is contained in:
Jelte Fennema 2014-08-14 14:32:51 +02:00
commit d54a039837

View File

@ -342,17 +342,10 @@ class Morris.Grid extends Morris.EventEmitter
else else
@left + (y - @ymin) * @dy @left + (y - @ymin) * @dy
transX: (x) -> transX: (x) ->
if @options.horizontal
start = @left
end = @right
else
start = @top
end = @bottom
if @data.length == 1 if @data.length == 1
(start + end) / 2 (@xStart + @xEnd) / 2
else else
start + (x - @xmin) * @dx @xStart + (x - @xmin) * @dx
# Draw it! # Draw it!