【发布时间】:2021-02-08 09:15:25
【问题描述】:
我需要在react.js项目中画上图 我试过高聊,但是,我不能让绿色部分的宽度不同。
下面是我使用高聊的尝试结果。
const hOptions = {
chart: {
type: 'pie',
margin: 0,
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: false
},
colors: ['#48EFBC', '#6672FB'],
title: {
text: null
},
series: [{
data: [80, 30],
dataLabels: {
formatter: function () {
return this.y > 5 ? this.point.name : null;
},
color: '#ff0000',
distance: -30
},
colors: ['blue', '#ffffff'],
size: '50%'
},
{
data: [80, 30],
dataLabels: {
formatter: function () {
return this.y > 5 ? this.point.name : null;
},
color: '#ff0000',
distance: -30
},
colors: ['#ffffff', 'red'],
size: '40%'
}],
legend: {
enabled: true
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: false
},
showInLegend: true,
center: ['50%', '30%'],
innerSize: '50%',
states: {
inactive: {
enabled: false
},
// hover: {
// color: 'blue'
// }
}
}
},
}
【问题讨论】:
标签: javascript reactjs charts customization