[IMP] adds stacked/grouped setting to chart widget (addon web_graph)

bzr revid: ged@openerp.com-20131218152048-36no38nud6a5ft10
This commit is contained in:
Gery Debongnie 2013-12-18 16:20:48 +01:00
parent 0e8a8517f8
commit 1323c2c25b
1 changed files with 7 additions and 3 deletions

View File

@ -165,6 +165,7 @@ instance.web_graph.Graph = instance.web.Widget.extend({
this.enabled = true;
if (_.has(options, 'enabled')) { this.enabled = options.enabled; }
this.visible_ui = true;
this.bar_ui = 'group'; // group or stack
this.config(options || {});
},
@ -173,6 +174,9 @@ instance.web_graph.Graph = instance.web.Widget.extend({
if (_.has(options, 'visible_ui')) {
this.visible_ui = options.visible_ui;
}
if (_.has(options, 'bar_ui')) {
this.bar_ui = options.bar_ui;
}
this.pivot.config(options);
},
@ -532,7 +536,7 @@ instance.web_graph.Graph = instance.web.Widget.extend({
});
nv.addGraph(function() {
var chart = nv.models.multiBarChart()
.stacked(true)
.stacked(self.bar_ui === 'stacked')
.tooltips(false)
.width(self.width)
.height(self.height)
@ -591,7 +595,7 @@ instance.web_graph.Graph = instance.web.Widget.extend({
nv.addGraph(function () {
var chart = nv.models.multiBarChart()
.stacked(true)
.stacked(self.bar_ui === 'stacked')
.staggerLabels(true)
.width(self.width)
.height(self.height)
@ -626,7 +630,7 @@ instance.web_graph.Graph = instance.web.Widget.extend({
nv.addGraph(function () {
var chart = nv.models.multiBarChart()
.stacked(true)
.stacked(self.bar_ui === 'stacked')
.staggerLabels(true)
.width(self.width)
.height(self.height)