Fix zero division for XLabels
This commit is contained in:
1 parent
f0c5b36a53
commit
7812f33dc4
1 file changed
+4
-1
@@ -150,7 +150,10 @@ class Graph(gtk.DrawingArea):
|
||||
keys = self.datas.keys()
|
||||
keys.sort()
|
||||
for key in keys:
|
||||
w = i / self.xrange
|
||||
if self.xrange == 0:
|
||||
w = 1.0
|
||||
else:
|
||||
w = i / self.xrange
|
||||
xlabels.append((w, str(self.labels[key])))
|
||||
i += 1
|
||||
return xlabels
|
||||
|
||||
Reference in new issue
Block a user