summaryrefslogtreecommitdiff
path: root/addons/web_graph/static/src
diff options
context:
space:
mode:
authorGery Debongnie <ged@openerp.com>2014-01-17 15:50:56 +0100
committerGery Debongnie <ged@openerp.com>2014-01-17 15:50:56 +0100
commit9a8d3950780f3ad90549ce80b5d74fdd0db9fecf (patch)
tree81c17fd6281b920a7b4f6472fd5f52464b8c2417 /addons/web_graph/static/src
parentc54746744251924691a9aa1170d32f3bc1c4d50d (diff)
[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
Diffstat (limited to 'addons/web_graph/static/src')
-rw-r--r--addons/web_graph/static/src/js/graph_widget.js3
1 files changed, 2 insertions, 1 deletions
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);