Skip to content

Commit

Permalink
Merge pull request #4429 from dippindots/fix-9902
Browse files Browse the repository at this point in the history
Always show label for pie chart when ratio is larger than 0.25
  • Loading branch information
alisman authored Nov 28, 2022
2 parents 9cf03e9 + b01ef33 commit 65ea8ca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion src/pages/studyView/charts/pieChart/PieChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,10 @@ export default class PieChart extends React.Component<IPieChartProps, {}>

@autobind
private label(d: ClinicalDataCountSummary) {
return d.count / this.totalCount > 0.5
// Always show label when ratio of pie is larger than 0.25
// If ratio of pie is less than 0.25, do check the max length we can show the text and the text length
// to decide if we should show the label or not
return d.count / this.totalCount > 0.25
? d.count.toLocaleString()
: this.maxLength(
d.count / this.totalCount,
Expand Down

0 comments on commit 65ea8ca

Please sign in to comment.