diff options
| author | Fabien Pinckaers <fp@tinyerp.com> | 2012-05-07 17:04:50 +0200 |
|---|---|---|
| committer | Fabien Pinckaers <fp@tinyerp.com> | 2012-05-07 17:04:50 +0200 |
| commit | 3a214057e4dbb559a14100c9003d2c2d23df1e76 (patch) | |
| tree | edc6e192f8debce1827c5e35887158b7d00291f3 /addons/web_graph/static/src/js | |
| parent | 22fb74570078646915791118d2869f0818a8526c (diff) | |
[IMP] Graphs
bzr revid: fp@tinyerp.com-20120507150450-v319vxug5d6a74mf
Diffstat (limited to 'addons/web_graph/static/src/js')
| -rw-r--r-- | addons/web_graph/static/src/js/graph.js | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/addons/web_graph/static/src/js/graph.js b/addons/web_graph/static/src/js/graph.js index 75490e076f9..9b4f123111e 100644 --- a/addons/web_graph/static/src/js/graph.js +++ b/addons/web_graph/static/src/js/graph.js @@ -40,9 +40,17 @@ instance.web_graph.GraphView = instance.web.View.extend({ on_loaded: function(fields_view_get) { // TODO: move to load_view and document + var width, height; var self = this; this.fields_view = fields_view_get; - this.container = this.$element.find("#editor-render-body")[0]; + this.container = this.$element.find("#editor-render-body"); + + width = this.$element.parent().width(); + this.container.css("width", width); + this.$element.css("width", width); + this.container.css("height", Math.min(500, width*0.8)); + this.container = this.container[0]; + this.$element.find("#graph_bar,#graph_bar_stacked").click( {mode: 'bar', stacked: true, legend: 'top'}, $.proxy(this,"graph_render")) @@ -127,7 +135,7 @@ instance.web_graph.GraphView = instance.web.View.extend({ show: this.spreadsheet, initialTab: "data" }, - HtmlText : (options && options.labelsAngle)?false:!this.forcehtml, + HtmlText : (options && options.xaxis && options.xaxis.labelsAngle)?false:!this.forcehtml, }, options) }, @@ -169,7 +177,7 @@ instance.web_graph.GraphView = instance.web.View.extend({ horizontalLines : !this.orientation, outline : "sw", }, - labelsAngle: 45 + xaxis : {labelsAngle: 45} }) ) }, @@ -215,7 +223,7 @@ instance.web_graph.GraphView = instance.web.View.extend({ horizontalLines : !this.orientation, outline : "sw", }, - labelsAngle : 45 + xaxis : {labelsAngle: 45} }) ) }, |
