reactjs - 如何在 recharts 中制作饼图 hiegher
问题描述
如何使图表中的饼图更高?容器中有空位,我想展开图表,如何?
我的代码是:
<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>
解决方案
如果要增加饼图的半径,请更改Pie
's outerRadius
prop.
您还可以更改innerRadius
道具以增加或减少馅饼中心孔的面积。
推荐阅读
- corda - Corda - 从 ServiceHub 获取状态机馈送
- java - 在 C 中创建新的头文件与在 Java 中创建类有何不同?
- php - 我如何在 PHP 中连接 MongoDB 在线云
- amazon-web-services - Aws - 使用 oom javascript 构建失败
- python - 使用 Python 语音识别时的说话人分类
- c++ - 冒泡排序的 C++ 问题
- python - 为什么 geopandas 中的线图在显示分层时会忽略绘图顺序
- c# - 无法在核心身份的 ApplicationUser 中保留关系
- windows - git-lfs .gitattributes 文件:奇怪的 unicode 字符
- mysql - MySQL 从 web 到循环网络中的本地服务器的连接