diff options
| author | Gery Debongnie <ged@openerp.com> | 2013-11-24 21:10:49 +0100 |
|---|---|---|
| committer | Gery Debongnie <ged@openerp.com> | 2013-11-24 21:10:49 +0100 |
| commit | 46ea9d29feb8d46eb5ee4d1900c955a219fca907 (patch) | |
| tree | 6678586f5fa2b42a7b876d5b5d66de15c84eb9e5 /addons/web_graph/static/src/js/graph.js | |
| parent | 40889788d3bb6cfac6a0dab0bf2d48e59409fe5a (diff) | |
[REF] better code organization for chart drawing in addon web_graph
bzr revid: ged@openerp.com-20131124201049-p7cealv5p11hofr2
Diffstat (limited to 'addons/web_graph/static/src/js/graph.js')
| -rw-r--r-- | addons/web_graph/static/src/js/graph.js | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/addons/web_graph/static/src/js/graph.js b/addons/web_graph/static/src/js/graph.js index 5dbe4b780cb..0a1dcdd001b 100644 --- a/addons/web_graph/static/src/js/graph.js +++ b/addons/web_graph/static/src/js/graph.js @@ -178,7 +178,6 @@ instance.web_graph.GraphView = instance.web.View.extend({ }, switch_mode: function (mode) { - var self = this; this.mode = mode; if (mode === 'pivot') { this.table.css('display', 'block'); @@ -188,7 +187,7 @@ instance.web_graph.GraphView = instance.web.View.extend({ this.svg.remove(); this.svg = $('<div><svg></svg></div>'); this.$el.filter('.graph_main_content').append(this.svg); - draw_chart(this.svg, mode, this.pivot_table); + draw_chart(mode, this.pivot_table); } }, @@ -326,9 +325,8 @@ instance.web_graph.GraphView = instance.web.View.extend({ cell.append((value === undefined) ? '' : value); if ((self.heat_map_mode) && (value !== undefined)) { - // heat map - var ratio = Math.floor(70 + 185*(pivot.total - value)/pivot.total); - cell.css("background-color", "rgb(255," + ratio + "," + ratio + ")"); + var color = Math.floor(50 + 205*(pivot.total - value)/pivot.total); + cell.css("background-color", "rgb(255," + color + "," + color + ")"); } html_row.append(cell); } |
