Skip to content

Commit

Permalink
Fix Kozea#112 thanks philt2001
Browse files Browse the repository at this point in the history
  • Loading branch information
paradoxxxzero committed Jun 12, 2014
1 parent 8bb982e commit 08e44d2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pygal/graph/line.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,17 @@ def _secondary_values(self):
def _fill(self, values):
"""Add extra values to fill the line"""
zero = self.view.y(min(max(self.zero, self._box.ymin), self._box.ymax))

# Check to see if the data has been padded with "none's"
# Fill doesn't work correctly otherwise
for i, (x, y) in enumerate(reversed(values)):
if x is not None:
end = -1 - i
break

return ([(values[0][0], zero)] +
values +
[(values[-1][0], zero)])
[(values[end][0], zero)])

def line(self, serie_node, serie, rescale=False):
"""Draw the line serie"""
Expand Down

0 comments on commit 08e44d2

Please sign in to comment.