如何使饼图在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>演示:https://jsfiddle.net/op0cq2ja/4/
查看图片中的问题:

发布于 2020-12-06 17:54:49
如果您想增加饼图的半径,请更改Pie的outerRadius属性。
还可以更改innerRadius道具,以增大或减小饼图中心的孔的面积。
https://stackoverflow.com/questions/65166399
复制相似问题