From f4805746ae1bc754caf39002035d64a9f2c63009 Mon Sep 17 00:00:00 2001 From: Worros Date: Wed, 15 Dec 2010 15:05:41 +0800 Subject: [PATCH] Grapher: Add 0th entry into winnings so graph starts at 0 --- pyfpdb/GuiGraphViewer.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pyfpdb/GuiGraphViewer.py b/pyfpdb/GuiGraphViewer.py index 443d65aa..2880a7d7 100644 --- a/pyfpdb/GuiGraphViewer.py +++ b/pyfpdb/GuiGraphViewer.py @@ -224,9 +224,6 @@ class GuiGraphViewer (threading.Thread): self.graphBox.add(self.canvas) self.canvas.show() self.canvas.draw() - - #TODO: Do something useful like alert user - #print "No hands returned by graph query" else: self.ax.set_title(_("Profit graph for ring games"+names),fontsize=12) @@ -340,7 +337,10 @@ class GuiGraphViewer (threading.Thread): if len(winnings) == 0: return (None, None, None) - green = map(lambda x:float(x[1]), winnings) + #Insert a 0th entry into winnings so graph starts 'zerod' + winnings.insert(0, (0,0,0)) + + green = map(lambda x: float(x[1]), winnings) blue = map(lambda x: float(x[1]) if x[2] == True else 0.0, winnings) red = map(lambda x: float(x[1]) if x[2] == False else 0.0, winnings) greenline = cumsum(green)