Pulled up map call to resolve issue with nulls in coordinate lists

createPath fails if the list contains 0 or 1 coordinate and multiples nulls
This commit is contained in:
Cory Thomas 2012-06-18 14:04:29 -05:00
parent 046903cd6f
commit a220fb6f4a

View File

@ -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)
@ -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]