diff options
| author | Xavier Morel <xmo@openerp.com> | 2011-06-20 19:09:22 +0200 |
|---|---|---|
| committer | Xavier Morel <xmo@openerp.com> | 2011-06-20 19:09:22 +0200 |
| commit | 9853c3a23ff5d4e89de9f43fd155e5bea6dbdb0a (patch) | |
| tree | d9f4b21d1f3fbf46c25347f88cd6ad133b1fdb96 /addons/base_graph/static/src | |
| parent | d44a542efbcb603d147115e4e450d28484e3c4df (diff) | |
| parent | ec186dfb7d394a337744a70aab3b042feeddbbf8 (diff) | |
[FIX] incompatibility between dhtmlx.Scheduler and dhtmlx.Chart, bug in dhtmlx.Chart when first data serties contains the value 0 in some places, race condition in graph addon
bzr revid: xmo@openerp.com-20110620170922-9443v3gtqza3vu2z
Diffstat (limited to 'addons/base_graph/static/src')
| -rw-r--r-- | addons/base_graph/static/src/js/graph.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/addons/base_graph/static/src/js/graph.js b/addons/base_graph/static/src/js/graph.js index 3186a50495f..07efe19e6f8 100644 --- a/addons/base_graph/static/src/js/graph.js +++ b/addons/base_graph/static/src/js/graph.js @@ -14,7 +14,7 @@ var COLOR_PALETTE = [ QWeb.add_template('/base_graph/static/src/xml/base_graph.xml'); openerp.base.views.add('graph', 'openerp.base_graph.GraphView'); -openerp.base_graph.GraphView = openerp.base.Controller.extend({ +openerp.base_graph.GraphView = openerp.base.View.extend({ init: function(view_manager, session, element_id, dataset, view_id) { this._super(session, element_id); @@ -31,7 +31,7 @@ openerp.base_graph.GraphView = openerp.base.Controller.extend({ this.$element.hide(); }, start: function() { - this.rpc("/base_graph/graphview/load", {"model": this.model, "view_id": this.view_id}, this.on_loaded); + return this.rpc("/base_graph/graphview/load", {"model": this.model, "view_id": this.view_id}, this.on_loaded); }, on_loaded: function(data) { this.all_fields = data.all_fields; @@ -270,7 +270,7 @@ openerp.base_graph.GraphView = openerp.base.Controller.extend({ y_axis = ordinate_description; } - var bar_chart = new dhtmlxchartChart({ + var bar_chart = new dhtmlXChart({ view: view_chart, container: self.elem_id+"-barchart", value:"#"+group_list[0]+"#", @@ -337,14 +337,14 @@ openerp.base_graph.GraphView = openerp.base.Controller.extend({ }, schedule_pie: function(result) { var self = this; - var chart = new dhtmlxchartChart({ + var chart = new dhtmlXChart({ view:"pie3D", container:self.elem_id+"-piechart", value:"#"+self.operator_field+"#", pieInnerText:function(obj) { var sum = chart.sum("#"+self.operator_field+"#"); var val = obj[self.operator_field] / sum * 100 ; - return Math.round(val * 10)/10 + "%"; + return val.toFixed(1) + "%"; }, gradient:"3d", height: 20, |
