[FIX] web: stacked bar is properly displayed

Stacked bar does not support the stacked option in the y axes.
This option was introduced in the stacked line generalization and was
set to False if the user is in the bar mode.

closes odoo/odoo#97410

Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
This commit is contained in:
Dardenne Florent (dafl)
2022-08-03 16:31:11 +02:00
parent 2add185ff5
commit 455a061d09
2 changed files with 4 additions and 4 deletions
@@ -439,7 +439,7 @@ export class GraphRenderer extends Component {
suggestedMax: 0,
suggestedMin: 0,
},
stacked: mode === "line" && stacked,
stacked: mode === "line" && stacked ? stacked : undefined,
};
return { xAxes: [xAxe], yAxes: [yAxe] };
}
@@ -916,9 +916,9 @@ QUnit.module("Views", (hooks) => {
"graph should be a classic line chart."
);
assert.strictEqual(
getScaleY(graph).every((y) => y.stacked),
false,
"The y axes should have stacked property set to false"
getScaleY(graph).every((y) => y.stacked == undefined),
true,
"The y axes should have stacked property set to undefined"
);
});