【发布时间】:2020-12-06 09:10:38
【问题描述】:
如何让recharts中的饼图更高?容器里有空位,我想展开图表,如何?
我的代码是:
<ResponsiveContainer
height={285}
>
<PieChart
margin={{ top: 0, left: 0, right: 0, bottom: 0 }}
>
<Pie
data={datasets}
innerRadius={60}
outerRadius={80}
fill="#8884d8"
paddingAngle={0}
dataKey="value"
>
{
datasets.map((_, index: number) => <Cell key={backgroundColor[index]} fill={backgroundColor[index]} />)
}
</Pie>
</PieChart>
</ResponsiveContainer>
【问题讨论】:
-
你能把你的代码分享给任何沙盒或codePen吗?
-
@Yoel 当然可以jsfiddle.net/op0cq2ja/4
-
@testomalta jsfiddle.net/p3q60e27/1
标签: reactjs pie-chart recharts