diff options
| author | Juhil Somaiya <jso@odoo.com> | 2018-12-19 12:17:19 +0000 |
|---|---|---|
| committer | Mathieu Duckerts-Antoine <dam@odoo.com> | 2019-02-25 08:26:10 +0000 |
| commit | b3b29f3b86f22b3157aba35e66e8ec3c16ee47bc (patch) | |
| tree | 7a5f638d22ff84f54124bc03819141425cc343d2 /addons/web/static/src/js/views/graph/graph_model.js | |
| parent | 23dcaf4836915b9d23a55b712746d159c19fa15d (diff) | |
[IMP] web: graph view legend and tooltips improvements
This commit ameliorates the tooltips and the legend
of the graph view in its different modes (bar, line, and pie).
Related task id: 1917940
Co-authored-by: Mohammed Shekha <msh@openerp.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
closes odoo/odoo#29747
Diffstat (limited to 'addons/web/static/src/js/views/graph/graph_model.js')
| -rw-r--r-- | addons/web/static/src/js/views/graph/graph_model.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/addons/web/static/src/js/views/graph/graph_model.js b/addons/web/static/src/js/views/graph/graph_model.js index 26c1aec6545..4c359a4778f 100644 --- a/addons/web/static/src/js/views/graph/graph_model.js +++ b/addons/web/static/src/js/views/graph/graph_model.js @@ -61,6 +61,7 @@ return AbstractModel.extend({ this.chart = { compare: params.compare, comparisonTimeRange: params.comparisonTimeRange, + comparisonTimeRangeDescription: params.comparisonTimeRangeDescription, data: [], groupedBy: params.groupedBy.length ? params.groupedBy : groupBys, // this parameter is not used anywhere for now. @@ -72,6 +73,7 @@ return AbstractModel.extend({ measure: params.context.graph_measure || params.measure, mode: params.context.graph_mode || params.mode, timeRange: params.timeRange, + timeRangeDescription: params.timeRangeDescription, domain: params.domain, context: params.context, }; @@ -100,14 +102,18 @@ return AbstractModel.extend({ this.chart.mode = params.context.graph_mode || this.chart.mode; var timeRangeMenuData = params.context.timeRangeMenuData; if (timeRangeMenuData) { - this.chart.timeRange = timeRangeMenuData.timeRange || []; this.chart.comparisonTimeRange = timeRangeMenuData.comparisonTimeRange || []; this.chart.compare = this.chart.comparisonTimeRange.length > 0; + this.chart.timeRange = timeRangeMenuData.timeRange || []; + this.chart.comparisonTimeRangeDescription = timeRangeMenuData.comparisonTimeRangeDescription; + this.chart.timeRangeDescription = timeRangeMenuData.timeRangeDescription; } else { - this.chart.timeRange = []; + this.chart = _.omit(this.chart, 'comparisonData'); this.chart.comparisonTimeRange = []; this.chart.compare = false; - this.chart = _.omit(this.chart, 'comparisonData'); + this.chart.timeRange = []; + this.chart.comparisonTimeRangeDescription = undefined; + this.chart.timeRangeDescription = undefined; } } if ('domain' in params) { |
