From 945719fb7dc9c63933dfbd0a27d557b4e0d2c3c6 Mon Sep 17 00:00:00 2001 From: Gery Debongnie Date: Wed, 11 Dec 2013 17:00:11 +0100 Subject: [PATCH] [FIX] correctly computes the height and the width of the graph view (addon web_graph) bzr revid: ged@openerp.com-20131211160011-fhv7ah63hlnyg7l0 --- addons/web_graph/static/src/js/graph.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/addons/web_graph/static/src/js/graph.js b/addons/web_graph/static/src/js/graph.js index 0b0078e..3640142 100644 --- a/addons/web_graph/static/src/js/graph.js +++ b/addons/web_graph/static/src/js/graph.js @@ -61,8 +61,6 @@ instance.web_graph.GraphView = instance.web.View.extend({ start: function () { this.table = $('
'); this.$('.graph_main_content').append(this.table); - this.width = this.$el.width(); - this.height = this.$el.parent().parent().height(); // to get view manager body instance.web.bus.on('click', this, function (ev) { if (this.dropdown) { this.dropdown.remove(); @@ -180,12 +178,17 @@ instance.web_graph.GraphView = instance.web.View.extend({ this.draw_table(); } else { this.$('.graph_main_content').append($('
')); + // console.log('this.perentaui', this.getParent().$el); + // this.width = this.$el.width(); + // this.height = this.$el.parent().parent().height(); // to get view manager body + + // debugger; var options = { svg: this.$('.graph_main_content svg')[0], mode: this.mode, pivot: this.pivot_table, - width: this.width, - height: Math.max(this.height - 45, 250), + width: this.$el.width(), + height: Math.max(this.$el.parent().parent().height() - 45, 250), measure_label: this.measure_label() }; openerp.web_graph.draw_chart(options); -- 1.7.10.4