Don't draw a path to null

This commit is contained in:
Jelte Fennema 2014-07-17 13:07:45 +02:00
parent a9076b2cc4
commit 96cb339717

View file

@ -129,7 +129,7 @@ class Morris.Line extends Morris.Grid
generatePaths: -> generatePaths: ->
@paths = for i in [0...@options.ykeys.length] @paths = for i in [0...@options.ykeys.length]
smooth = if typeof @options.smooth is "boolean" then @options.smooth else @options.ykeys[i] in @options.smooth smooth = if typeof @options.smooth is "boolean" then @options.smooth else @options.ykeys[i] in @options.smooth
coords = ({x: r._x, y: r._y[i]} for r in @data when r._y[i] isnt undefined) coords = ({x: r._x, y: r._y[i]} for r in @data when r._y[i]?)
if coords.length > 1 if coords.length > 1
Morris.Line.createPath coords, smooth, @bottom Morris.Line.createPath coords, smooth, @bottom