summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGery Debongnie <ged@openerp.com>2014-01-13 16:23:16 +0100
committerGery Debongnie <ged@openerp.com>2014-01-13 16:23:16 +0100
commit4d550e963ea07da045bcb8f68ec4fad5fc7b591d (patch)
tree5ef1906476498dcf647634087fa4f725881fbff6
parente2bb629c3c2528c26b216ff8fe21b4c4fb7634e0 (diff)
[FIX] fixes some issues with chart drawing in graph view (addon web_graph)
bzr revid: ged@openerp.com-20140113152316-4i3endkgu10jmxgc
-rw-r--r--addons/web_graph/static/src/js/graph.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/addons/web_graph/static/src/js/graph.js b/addons/web_graph/static/src/js/graph.js
index abd1d41d629..f39f0574e9b 100644
--- a/addons/web_graph/static/src/js/graph.js
+++ b/addons/web_graph/static/src/js/graph.js
@@ -184,6 +184,7 @@ instance.web_graph.Graph = instance.web.Widget.extend(openerp.EventDispatcherMix
this.mode = options.mode || 'pivot';
this.title = options.title || 'Graph';
this.visible_ui = options.visible_ui || true;
+ this.bar_ui = options.bar_ui || 'group';
this.pivot_options = options;
},
@@ -325,13 +326,13 @@ instance.web_graph.Graph = instance.web.Widget.extend(openerp.EventDispatcherMix
switch (event.target.attributes['data-choice'].nodeValue) {
case 'bar_grouped':
this.bar_ui = 'group';
- if (this.mode === 'bar_chart') {
+ if (this.mode === 'bar') {
this.display_data();
}
break;
case 'bar_stacked':
this.bar_ui = 'stack';
- if (this.mode === 'bar_chart') {
+ if (this.mode === 'bar') {
this.display_data();
}
break;
@@ -609,7 +610,7 @@ instance.web_graph.Graph = instance.web.Widget.extend(openerp.EventDispatcherMix
var values = _.map(self.pivot.get_rows_with_depth(1), function (header) {
return {
x: header.title || 'Undefined',
- y: self.pivot.get_values(header.id, colhdr.id, 0)[0]
+ y: self.pivot.get_values(header.id, colhdr.id)[0] || 0
};
});
return {key: colhdr.title || 'Undefined', values: values};