summaryrefslogtreecommitdiff
path: root/addons/web_graph/static/src/js/pivot.js
diff options
context:
space:
mode:
authorGery Debongnie <ged@openerp.com>2013-11-22 17:04:49 +0100
committerGery Debongnie <ged@openerp.com>2013-11-22 17:04:49 +0100
commit7299cde4cf2063dbccc797b6612c2b41c3564a8e (patch)
treea3c90ca3b780a208936435260b8a303d788e0311 /addons/web_graph/static/src/js/pivot.js
parent200762944abc00e5cb748af96583302237c9a669 (diff)
[REF] large refactoring. it separates the data handling code (pivot) from the ui code (drawing, buttons, events (addon web_graph)
bzr revid: ged@openerp.com-20131122160449-lv2t09bs67ux42m5
Diffstat (limited to 'addons/web_graph/static/src/js/pivot.js')
-rw-r--r--addons/web_graph/static/src/js/pivot.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/addons/web_graph/static/src/js/pivot.js b/addons/web_graph/static/src/js/pivot.js
index 081470fcb37..4ab6b637422 100644
--- a/addons/web_graph/static/src/js/pivot.js
+++ b/addons/web_graph/static/src/js/pivot.js
@@ -1,5 +1,4 @@
-
var PivotTable = openerp.web.Class.extend({
init: function (options) {
this.rows = [];
@@ -198,7 +197,6 @@ var PivotTable = openerp.web.Class.extend({
});
col.is_expanded = true;
});
-
},
make_col: function (groups, parent) {
@@ -216,6 +214,15 @@ var PivotTable = openerp.web.Class.extend({
return new_col.id;
},
+ get_chart_data: function () {
+ var self = this;
+ var values = _.map(this.rows[0].children, function (pt) {
+ var val = self.get_value(pt.id, 2);
+ return {x: pt.name, y: val};
+ });
+ return [{key: 'Bar chart', values: values}];
+
+ },
});