0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-17 23:44:39 -05:00

Removed zero tiers from paid mix charts (unless all zero)

no issue

When the last tier in the paid mix chart is zero, the border radius is broken.
This commit is contained in:
Simon Backx 2022-05-19 11:41:54 +02:00
parent 1ce02660aa
commit f9cd8b1f66

View file

@ -346,6 +346,12 @@ export default class PaidMix extends Component {
}
for (let i = 0; i < data.length; i++) {
if (!this.areTiersAllZero && data[i] === 0) {
// If not all tiers are zero, hide tiers with 0 members, because
// they are not visible in the graph and can break rounded corners
continue;
}
let tierPercentage = Math.round(data[i] / totalTiersAmount * 100);
// The first value has to be negative to make rounded corners work