diff --git a/addons/web/static/src/views/graph/graph_arch_parser.js b/addons/web/static/src/views/graph/graph_arch_parser.js index caa1e021090..d01f91d4d82 100644 --- a/addons/web/static/src/views/graph/graph_arch_parser.js +++ b/addons/web/static/src/views/graph/graph_arch_parser.js @@ -22,6 +22,9 @@ export class GraphArchParser extends XMLParser { if (node.hasAttribute("stacked")) { archInfo.stacked = archParseBoolean(node.getAttribute("stacked")); } + if (node.hasAttribute("cumulated")) { + archInfo.cumulated = archParseBoolean(node.getAttribute("cumulated")); + } const mode = node.getAttribute("type"); if (mode && MODES.includes(mode)) { archInfo.mode = mode; diff --git a/addons/web/static/src/views/graph/graph_controller.js b/addons/web/static/src/views/graph/graph_controller.js index 0e1ddd3dd4c..c77923e058d 100644 --- a/addons/web/static/src/views/graph/graph_controller.js +++ b/addons/web/static/src/views/graph/graph_controller.js @@ -112,6 +112,11 @@ export class GraphController extends Component { const { stacked } = this.model.metaData; this.model.updateMetaData({ stacked: !stacked }); } + + toggleCumulated() { + const { cumulated } = this.model.metaData; + this.model.updateMetaData({ cumulated: !cumulated }); + } } GraphController.template = "web.GraphView"; diff --git a/addons/web/static/src/views/graph/graph_controller.xml b/addons/web/static/src/views/graph/graph_controller.xml index ec97f5b03c6..75049f4574b 100644 --- a/addons/web/static/src/views/graph/graph_controller.xml +++ b/addons/web/static/src/views/graph/graph_controller.xml @@ -38,6 +38,10 @@ t-on-click="toggleStacked" t-att-class="{ active: model.metaData.stacked }" /> +