summaryrefslogtreecommitdiff
path: root/addons/web_graph/static/src/js
diff options
context:
space:
mode:
authorGery Debongnie <ged@openerp.com>2013-11-25 10:15:05 +0100
committerGery Debongnie <ged@openerp.com>2013-11-25 10:15:05 +0100
commitd8aa7a6551ddb0b540cd14c35d4482d79f746fb5 (patch)
tree6bed62a39b293f42592acff0b924acf72c1d7994 /addons/web_graph/static/src/js
parent7940ec40c65214a2bdcd800a1dd2291980abc25b (diff)
[IMP] improves the look of the total in each rows in pivot table view (addon web_graph)
bzr revid: ged@openerp.com-20131125091505-wts1llbdexhnl8fe
Diffstat (limited to 'addons/web_graph/static/src/js')
-rw-r--r--addons/web_graph/static/src/js/graph.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/addons/web_graph/static/src/js/graph.js b/addons/web_graph/static/src/js/graph.js
index 69155e7b255..2c3645341d8 100644
--- a/addons/web_graph/static/src/js/graph.js
+++ b/addons/web_graph/static/src/js/graph.js
@@ -284,7 +284,7 @@ instance.web_graph.GraphView = instance.web.View.extend({
make_cells(pivot.cols.headers, 0);
} else {
make_cells(pivot.cols.main.children, 1);
- header_cells[0].push(self.make_border_cell(1, height).append('Total'));
+ header_cells[0].push(self.make_border_cell(1, height).append('Total').css('font-weight', 'bold'));
}
_.each(header_cells, function (cells) {
@@ -323,10 +323,16 @@ instance.web_graph.GraphView = instance.web.View.extend({
html_row.append(cell);
}
});
- var cell = $('<td></td>').append(pivot.get_value(row.id,pivot.cols.main.id));
+ var total = pivot.get_value(row.id, pivot.cols.main.id);
+ var cell = $('<td></td>')
+ .append(total)
+ .css('font-weight', 'bold');
if (row.is_expanded && (row.path.length <= 2)) {
var color = row.path.length * 5 + 240;
cell.css("background-color", "rgb(" + [color, color, color].join() + ")");
+ } else if (self.heat_map_mode) {
+ var color = Math.floor(50 + 205*(pivot.total - total)/pivot.total);
+ cell.css("background-color", "rgb(255," + color + "," + color + ")");
}
if (pivot.cols.main.children.length > 0) {