From 7b171c0eacd24532056d38fcf85f4ab2e811f4f4 Mon Sep 17 00:00:00 2001 From: "Vidhin Mehta (OpenERP)" Date: Wed, 1 Feb 2012 14:32:21 +0530 Subject: [IMP]graph x axis item. bzr revid: vme@tinyerp.com-20120201090221-44sxb9m418nhukly --- addons/web_graph/static/src/js/graph.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'addons/web_graph/static/src/js/graph.js') diff --git a/addons/web_graph/static/src/js/graph.js b/addons/web_graph/static/src/js/graph.js index f153a2155f0..966f3c1b006 100644 --- a/addons/web_graph/static/src/js/graph.js +++ b/addons/web_graph/static/src/js/graph.js @@ -97,7 +97,7 @@ openerp.web_graph.GraphView = openerp.web.View.extend({ this.$element.html(QWeb.render("GraphView", { "fields_view": this.fields_view, "chart": this.chart, - 'element_id': this.element_id + 'element_id': this.widget_parent.element_id })); var fields = _(this.columns).pluck('name').concat([this.abscissa]); @@ -267,7 +267,7 @@ openerp.web_graph.GraphView = openerp.web.View.extend({ self.renderer = null; var charts = new dhtmlXChart({ view: view_chart, - container: self.element_id+"-"+self.chart+"chart", + container: self.widget_parent.element_id+"-"+self.chart+"chart", value:"#"+group_list[0].group+"#", gradient: (self.chart == "bar") ? "3d" : "light", alpha: (self.chart == "area") ? 0.6 : 1, @@ -304,6 +304,8 @@ openerp.web_graph.GraphView = openerp.web.View.extend({ } } }); + self.$element.find("#"+self.widget_parent.element_id+"-"+self.chart+"chart").width( + self.$element.find("#"+self.widget_parent.element_id+"-"+self.chart+"chart").width()+120); for (var m = 1; m Date: Fri, 10 Feb 2012 19:18:58 +0530 Subject: [IMP]fix graph issue when no data. lp bug: https://launchpad.net/bugs/928123 fixed bzr revid: vme@tinyerp.com-20120210134858-kq1oxpsikpuc8kxn --- addons/web_graph/static/src/js/graph.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web_graph/static/src/js/graph.js') diff --git a/addons/web_graph/static/src/js/graph.js b/addons/web_graph/static/src/js/graph.js index 966f3c1b006..124c339457d 100644 --- a/addons/web_graph/static/src/js/graph.js +++ b/addons/web_graph/static/src/js/graph.js @@ -183,7 +183,7 @@ openerp.web_graph.GraphView = openerp.web.View.extend({ var self = this; var group_list, view_chart = (self.chart == 'line')?'line':(self.chart == 'area')?'area':''; - if (!this.group_field) { + if (!this.group_field || !results.length) { if (self.chart == 'bar'){ view_chart = (this.orientation === 'horizontal') ? 'barH' : 'bar'; } -- cgit v1.2.3