diff options
| author | Gery Debongnie <ged@openerp.com> | 2013-12-18 16:20:48 +0100 |
|---|---|---|
| committer | Gery Debongnie <ged@openerp.com> | 2013-12-18 16:20:48 +0100 |
| commit | 1323c2c25b01d894f731fd1c2f76d5fabd610223 (patch) | |
| tree | 584aa1fa1830a9621d0b965ba88c78ce8ca4216a /addons/web_graph/static/src/js/graph.js | |
| parent | 0e8a8517f8ec74690c8819b00194efb667e04429 (diff) | |
[IMP] adds stacked/grouped setting to chart widget (addon web_graph)
bzr revid: ged@openerp.com-20131218152048-36no38nud6a5ft10
Diffstat (limited to 'addons/web_graph/static/src/js/graph.js')
| -rw-r--r-- | addons/web_graph/static/src/js/graph.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/addons/web_graph/static/src/js/graph.js b/addons/web_graph/static/src/js/graph.js index 3c0fe1a8be5..145ee079c07 100644 --- a/addons/web_graph/static/src/js/graph.js +++ b/addons/web_graph/static/src/js/graph.js @@ -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) |
