mirror of
https://github.com/morrisjs/morris.js.git
synced 2024-11-13 07:11:12 +01:00
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:
parent
046903cd6f
commit
a220fb6f4a
1 changed files with 2 additions and 3 deletions
|
@ -267,7 +267,7 @@ class Morris.Line
|
||||||
#
|
#
|
||||||
drawSeries: ->
|
drawSeries: ->
|
||||||
for i in [@seriesCoords.length-1..0]
|
for i in [@seriesCoords.length-1..0]
|
||||||
coords = @seriesCoords[i]
|
coords = $.map(@seriesCoords[i], (c) -> c)
|
||||||
if coords.length > 1
|
if coords.length > 1
|
||||||
path = @createPath coords, @options.marginTop, @left, @options.marginTop + @height, @left + @width
|
path = @createPath coords, @options.marginTop, @left, @options.marginTop + @height, @left + @width
|
||||||
@r.path(path)
|
@r.path(path)
|
||||||
|
@ -287,9 +287,8 @@ class Morris.Line
|
||||||
|
|
||||||
# create a path for a data series
|
# create a path for a data series
|
||||||
#
|
#
|
||||||
createPath: (all_coords, top, left, bottom, right) ->
|
createPath: (coords, top, left, bottom, right) ->
|
||||||
path = ""
|
path = ""
|
||||||
coords = $.map(all_coords, (c) -> c)
|
|
||||||
if @options.smooth
|
if @options.smooth
|
||||||
grads = @gradients coords
|
grads = @gradients coords
|
||||||
for i in [0..coords.length-1]
|
for i in [0..coords.length-1]
|
||||||
|
|
Loading…
Reference in a new issue