Author: eallen
Date: 2008-11-06 11:04:46 -0500 (Thu, 06 Nov 2008)
New Revision: 2757
Modified:
mgmt/trunk/cumin/python/cumin/charts.py
Log:
Prevent stats line graph from drawing past right side of grid
Modified: mgmt/trunk/cumin/python/cumin/charts.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/charts.py 2008-11-06 15:52:38 UTC (rev 2756)
+++ mgmt/trunk/cumin/python/cumin/charts.py 2008-11-06 16:04:46 UTC (rev 2757)
@@ -33,7 +33,10 @@
value = 0
t = secs(dt)
-
+ # prevent line from drawing off right side of grid
+ if tnow - t < 0:
+ t = tnow
+
x = self.width - ((tnow - t) / float(self.x_max)) * self.width
y = self.height - (value / float(self.y_max)) * self.height
cr.line_to(x, y)
Show replies by date