Use dominant-baseline to fix for rendering issue in Firefox

This commit is contained in:
akash-akya 2022-09-25 21:23:34 +05:30
parent 2809e2143f
commit 22bc27fc94
1 changed files with 3 additions and 3 deletions

View File

@ -196,7 +196,7 @@ function renderOverview(gains: Gain[]) {
textGroup
.append("text")
.text((g) => formatCurrency(getInvestmentAmount(g)))
.attr("alignment-baseline", "hanging")
.attr("dominant-baseline", "hanging")
.attr("text-anchor", "end")
.style("fill", (g) =>
getInvestmentAmount(g) > 0 ? z("investment") : "none"
@ -209,7 +209,7 @@ function renderOverview(gains: Gain[]) {
textGroup
.append("text")
.text((g) => formatCurrency(getGainAmount(g)))
.attr("alignment-baseline", "hanging")
.attr("dominant-baseline", "hanging")
.attr("text-anchor", "end")
.style("fill", (g) =>
getGainAmount(g) > 0 ? chroma(z("gain")).darken().hex() : "none"
@ -265,7 +265,7 @@ function renderOverview(gains: Gain[]) {
.append("text")
.text((g) => formatFloat(g.xirr))
.attr("text-anchor", "end")
.attr("alignment-baseline", "middle")
.attr("dominant-baseline", "middle")
.style("fill", (g) =>
g.xirr < 0
? chroma(z("loss")).darken().hex()