Skip to content

Commit

Permalink
Pulled up map call to resolve issue with nulls in coordinate lists
Browse files Browse the repository at this point in the history
createPath fails if the list contains 0 or 1 coordinate and multiples nulls
  • Loading branch information
dump247 committed Jun 18, 2012
1 parent 046903c commit a220fb6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions morris.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ class Morris.Line
#
drawSeries: ->
for i in [@seriesCoords.length-1..0]
coords = @seriesCoords[i]
coords = $.map(@seriesCoords[i], (c) -> c)
if coords.length > 1
path = @createPath coords, @options.marginTop, @left, @options.marginTop + @height, @left + @width
@r.path(path)
Expand All @@ -287,9 +287,8 @@ class Morris.Line

# create a path for a data series
#
createPath: (all_coords, top, left, bottom, right) ->
createPath: (coords, top, left, bottom, right) ->
path = ""
coords = $.map(all_coords, (c) -> c)
if @options.smooth
grads = @gradients coords
for i in [0..coords.length-1]
Expand Down

0 comments on commit a220fb6

Please sign in to comment.