我是 React 新手,想从 PrimeReact 更改甜甜圈图的标签位置(https://www.primefaces.org/primereact/#/doughnutchart)。
我检查了Primereact 内部用于图表的链接( https://www.chartjs.org/docs/latest/charts/doughnut.html ),并没有找到改变位置等的选项。有没有办法实现?
我还想在甜甜圈的中心放一些文字。
TIA
我是 React 新手,想从 PrimeReact 更改甜甜圈图的标签位置(https://www.primefaces.org/primereact/#/doughnutchart)。
我检查了Primereact 内部用于图表的链接( https://www.chartjs.org/docs/latest/charts/doughnut.html ),并没有找到改变位置等的选项。有没有办法实现?
我还想在甜甜圈的中心放一些文字。
TIA
这是图表 jsx:
const option = {
maintainAspectRatio: false,
responsive: false,
legend: {
position: 'left',
labels: {
boxWidth: 10
}
}
}
<Chart
style={{ width: "90%", height: "90%" }}
type="doughnut"
data={data}
options={option}
/>
user578219 的回答也非常适合我的问题。我还在寻找在甜甜圈中心包含标签的选项 - 是否有任何地方可以找到可以使用的选项列表?