diff options
| author | jpr-odoo <jpr@openerp.com> | 2018-12-17 05:13:49 +0000 |
|---|---|---|
| committer | Mathieu Duckerts-Antoine <dam@odoo.com> | 2019-02-20 09:28:07 +0000 |
| commit | 3461637b7ab6127f4a27fdef6d67288f0250ea68 (patch) | |
| tree | f2435df9e67f79b1ee60b4163c8abc513349e25b /addons/web/static/src | |
| parent | 726aeefe36e79e692af5b9eb33e922dfedaced62 (diff) | |
[IMP] web: group by more than two fields in graph view
Before this commit: select more than two groupbys
in a graph view would have no impact at all if mode
'bar' or 'line' is selected.
This commit allows to correctly handle more than
two groupbys in all modes.
Task ID: 1917948
closes odoo/odoo#29673
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/views/graph/graph_renderer.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/addons/web/static/src/js/views/graph/graph_renderer.js b/addons/web/static/src/js/views/graph/graph_renderer.js index 09706695bbc..7de98b29e6b 100644 --- a/addons/web/static/src/js/views/graph/graph_renderer.js +++ b/addons/web/static/src/js/views/graph/graph_renderer.js @@ -174,12 +174,12 @@ return AbstractRenderer.extend({ values = {}; for (var i = 0; i < this.state.data.length; i++) { label = this.state.data[i].labels[0]; - serie = this.state.data[i].labels[1]; + serie = this.state.data[i].labels.slice(1).join("/"); value = this.state.data[i].value; if ((!xlabels.length) || (xlabels[xlabels.length-1] !== label)) { xlabels.push(label); } - series.push(this.state.data[i].labels[1]); + series.push(serie); if (!(serie in values)) {values[serie] = {};} values[serie][label] = this.state.data[i].value; } @@ -403,7 +403,7 @@ return AbstractRenderer.extend({ ticksLabels.push(tickLabel); tick++; } - serie = graphData[i].labels[1]; + serie = graphData[i].labels.slice(1).join("/"); if (!data_dict[serie]) { data_dict[serie] = { values: [], |
