[XY axis] Fixes bug on bar charts preventing unstacked mode (#90602)

This commit is contained in:
Stratoula Kalafateli 2021-02-11 16:12:01 +02:00 committed by GitHub
parent e3f672926e
commit 847d57b3e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -98,10 +98,6 @@ const shouldEnableHistogramMode = (
);
});
if (bars.length === 1) {
return true;
}
const groupIds = [
...bars.reduce<Set<string>>((acc, { valueAxis: groupId, mode }) => {
acc.add(groupId);
@ -113,11 +109,9 @@ const shouldEnableHistogramMode = (
return false;
}
const test = bars.every(({ valueAxis: groupId, mode }) => {
return bars.every(({ valueAxis: groupId, mode }) => {
const yAxisScale = yAxes.find(({ groupId: axisGroupId }) => axisGroupId === groupId)?.scale;
return mode === 'stacked' || yAxisScale?.mode === 'percentage';
});
return test;
};