Prevent ZeroDivisionError in graph
This commit is contained in:
1 parent
69a340ca81
commit
1d1b136ea8
1 file changed
+1
-1
@@ -401,7 +401,7 @@ class Graph(gtk.DrawingArea):
|
||||
r, g, b = hex2rgb(COLOR_SCHEMES.get(color, color))
|
||||
maxcolor = max(max(r, g), b)
|
||||
self.colorScheme = generateColorscheme(color, keys + ['__highlight'],
|
||||
maxcolor / len(keys))
|
||||
maxcolor / (len(keys) or 1))
|
||||
for yfield in self.yfields:
|
||||
if yfield.get('color'):
|
||||
self.colorScheme[yfield.get('key', yfield['name'])] = hex2rgb(
|
||||
|
||||
Reference in new issue
Block a user