[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
This commit is contained in:
Gery Debongnie 2014-01-17 15:50:56 +01:00
parent c547467442
commit 9a8d395078
1 changed files with 2 additions and 1 deletions

View File

@ -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);