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:
parent
1ce02660aa
commit
f9cd8b1f66
1 changed files with 6 additions and 0 deletions
|
@ -346,6 +346,12 @@ export default class PaidMix extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let i = 0; i < data.length; i++) {
|
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);
|
let tierPercentage = Math.round(data[i] / totalTiersAmount * 100);
|
||||||
|
|
||||||
// The first value has to be negative to make rounded corners work
|
// The first value has to be negative to make rounded corners work
|
||||||
|
|
Loading…
Add table
Reference in a new issue