From 9a8d3950780f3ad90549ce80b5d74fdd0db9fecf Mon Sep 17 00:00:00 2001 From: Gery Debongnie Date: Fri, 17 Jan 2014 15:50:56 +0100 Subject: [IMP] display bar chart controls when the size is large enough and when it makes sense (dim x + dim y >= 2) in grap view (addon web_graph) bzr revid: ged@openerp.com-20140117145056-dby0g4sj7v056gpq --- addons/web_graph/static/src/js/graph_widget.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'addons/web_graph/static/src/js/graph_widget.js') diff --git a/addons/web_graph/static/src/js/graph_widget.js b/addons/web_graph/static/src/js/graph_widget.js index 85b37170a4b..66e40a00849 100644 --- a/addons/web_graph/static/src/js/graph_widget.js +++ b/addons/web_graph/static/src/js/graph_widget.js @@ -495,6 +495,7 @@ openerp.web_graph.Graph = openerp.web.Widget.extend(openerp.EventDispatcherMixin var self = this, dim_x = this.pivot.rows.groupby.length, dim_y = this.pivot.cols.groupby.length, + show_controls = (this.width > 400 && this.height > 300 && dim_x + dim_y >=2), data; // No groupby @@ -555,7 +556,7 @@ openerp.web_graph.Graph = openerp.web.Widget.extend(openerp.EventDispatcherMixin .height(self.height) .reduceXTicks(false) .stacked(self.bar_ui === 'stack') - .showControls(false); + .showControls(show_controls); if (self.width / data[0].values.length < 80) { chart.rotateLabels(-15); -- cgit v1.2.3