Skip to content

Commit

Permalink
CORE-4993: add sdg % text
Browse files Browse the repository at this point in the history
  • Loading branch information
ekachxaidze98 committed Oct 29, 2024
1 parent f1e1366 commit 672d089
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion templates/sdg/charts/horizontalSdgChart.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const CustomYAxisTick = ({ x, y, data, index }) => {
}

const CustomLabel = ({ x, y, width, value, totalOutputCount, toggle }) => {
const labelWidth = value.toString().length * 30
const labelWidth = value.toString().length * 40
const fitsInside = width > labelWidth
const displayValue = toggle
? `${((value / totalOutputCount) * 100).toFixed(2)}%`
Expand Down
6 changes: 3 additions & 3 deletions templates/sdg/charts/reChartBarChart.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ const ReChartBarChart = ({
return (
// eslint-disable-next-line react/no-array-index-key
<p key={`item-${index}`} style={{ color }}>
{entry.name} (proportion of all papers with SDG):{' '}
{firstPercentage}%
{firstPercentage}% of all papers belong to {entry.name}
<br />
{entry.name} (percentage of all papers): {secondPercentage}%
{secondPercentage}% of papers with an SDG label belong to{' '}
{entry.name}
</p>
)
}
Expand Down

0 comments on commit 672d089

Please sign in to comment.