From 4d550e963ea07da045bcb8f68ec4fad5fc7b591d Mon Sep 17 00:00:00 2001 From: Gery Debongnie Date: Mon, 13 Jan 2014 16:23:16 +0100 Subject: [PATCH] [FIX] fixes some issues with chart drawing in graph view (addon web_graph) bzr revid: ged@openerp.com-20140113152316-4i3endkgu10jmxgc --- addons/web_graph/static/src/js/graph.js | 7 ++++--- 1 file 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};