Skip to content

Commit

Permalink
Merge pull request #859 from alexstotsky/fix-pie-chart-cut-off
Browse files Browse the repository at this point in the history
(improvement) Concentration risk pie chart
  • Loading branch information
ezewer authored Sep 13, 2024
2 parents 1785629 + d0fcba7 commit f33494a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/ui/Charts/PieChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,19 @@ class PieChart extends PureComponent {
return COLORS[index % COLORS.length]
}

getChartHeight = () => {
const { data } = this.props
// base height + 18px for each 4 items row
return 340 + data?.length / 4 * 18
}

render() {
const { data } = this.props

return (
<SimplePieChart
width={282}
height={340}
height={this.getChartHeight()}
>
<Pie
data={data}
Expand Down

0 comments on commit f33494a

Please sign in to comment.