diff options
| author | Gery Debongnie <ged@openerp.com> | 2013-12-11 17:00:11 +0100 |
|---|---|---|
| committer | Gery Debongnie <ged@openerp.com> | 2013-12-11 17:00:11 +0100 |
| commit | 945719fb7dc9c63933dfbd0a27d557b4e0d2c3c6 (patch) | |
| tree | 3d343b04ac51ba8af0efe14e5d1d82c342e89b23 /addons/web_graph/static/src/js/graph.js | |
| parent | 8da86807b6d459a7c6d010e447ea006c61790923 (diff) | |
[FIX] correctly computes the height and the width of the graph view (addon web_graph)
bzr revid: ged@openerp.com-20131211160011-fhv7ah63hlnyg7l0
Diffstat (limited to 'addons/web_graph/static/src/js/graph.js')
| -rw-r--r-- | addons/web_graph/static/src/js/graph.js | 11 |
1 files 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 0b0078e7ff1..364014288c1 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 = $('<table></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($('<div><svg></svg></div>')); + // 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); |
