Support sparse data in y's graph with domain
The value when the domain skip the record should be undefined so the graph has no point at this ordinate. issue10072 review337561002
This commit is contained in:
1 parent
b2cfb5cd85
commit
d45dbd0cc2
1 file changed
+1
-1
@@ -370,7 +370,6 @@ class Graph(Gtk.DrawingArea):
|
||||
self.datas.setdefault(x, {})
|
||||
for yfield in self.yfields:
|
||||
key = yfield.get('key', yfield['name'])
|
||||
self.datas[x].setdefault(key, 0.0)
|
||||
if yfield.get('domain'):
|
||||
context = rpc.CONTEXT.copy()
|
||||
context['context'] = context.copy()
|
||||
@@ -379,6 +378,7 @@ class Graph(Gtk.DrawingArea):
|
||||
context[field] = model[field].get(model)
|
||||
if not PYSONDecoder(context).decode(yfield['domain']):
|
||||
continue
|
||||
self.datas[x].setdefault(key, 0.0)
|
||||
if yfield['name'] == '#':
|
||||
self.datas[x][key] += 1
|
||||
else:
|
||||
|
||||
Reference in new issue
Block a user