diff options
| author | Gery Debongnie <ged@openerp.com> | 2014-01-06 09:37:34 +0100 |
|---|---|---|
| committer | Gery Debongnie <ged@openerp.com> | 2014-01-06 09:37:34 +0100 |
| commit | 6a422f27d7bffd8457f275e2cc3c41f58e37a66d (patch) | |
| tree | 17c208fad0cb24a3d71aa014f5b365e4ad96eb0e /addons/web_graph/static/src | |
| parent | 47762dfca2c49a8da9f9fd1b57f966a27d96f602 (diff) | |
[FIX] fixes the computation of the color displayed in heatmap modes in graph view. (addon web_graph)
bzr revid: ged@openerp.com-20140106083734-qkrvuhe7398me2d2
Diffstat (limited to 'addons/web_graph/static/src')
| -rw-r--r-- | addons/web_graph/static/src/js/graph.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/addons/web_graph/static/src/js/graph.js b/addons/web_graph/static/src/js/graph.js index e8e4e561ef4..7973a5646bc 100644 --- a/addons/web_graph/static/src/js/graph.js +++ b/addons/web_graph/static/src/js/graph.js @@ -570,7 +570,7 @@ instance.web_graph.Graph = instance.web.Widget.extend({ if (pivot.get_cols_leaves().length > 1) { var total_vals = pivot.get_total(row); for (var j = 0; j < total_vals.length; j++) { - var cell = make_cell(total_vals[j], measure_types[j], i, pivot.cols.main).css('font-weight', 'bold'); + var cell = make_cell(total_vals[j], measure_types[j], j, pivot.cols.main).css('font-weight', 'bold'); html_row.append(cell); } } @@ -586,17 +586,17 @@ instance.web_graph.Graph = instance.web.Widget.extend({ } cell.append(instance.web.format_value(value, {type: measure_type})); if (self.mode === 'heatmap') { - total = pivot.get_total()[i]; + total = pivot.get_total()[index]; color = Math.floor(90 + 165*(total - Math.abs(value))/total); cell.css('background-color', $.Color(255, color, color)); } if (self.mode === 'row_heatmap') { - total = pivot.get_total(row)[i]; + total = pivot.get_total(row)[index]; color = Math.floor(90 + 165*(total - Math.abs(value))/total); cell.css('background-color', $.Color(255, color, color)); } if (self.mode === 'col_heatmap') { - total = pivot.get_total(col)[i]; + total = pivot.get_total(col)[index]; color = Math.floor(90 + 165*(total - Math.abs(value))/total); cell.css('background-color', $.Color(255, color, color)); } |
