項(xiàng)目種需要使用餅圖,但是樣式稍微有點(diǎn)不一樣,在此記錄echarts畫(huà)南丁格爾玫瑰圖
option = {
legend: {
top: 'top'
},
toolbox: {
show: false
},
series: [
{
name: 'Nightingale Chart',
type: 'pie',
radius: ['20%', '70%'],
center: ['50%', '50%'],
// 設(shè)置角度
startAngle: 180,
roseType: 'area',
hoverAnimation: false,
itemStyle: {
borderRadius: 0
},
labelLine: {
normal: {
show: false
}
},
label: {
show: false
},
data: [
{ value: 40, name: 'rose 1' },
{ value: 38, name: 'rose 2' },
{ value: 32, name: 'rose 3' },
{ value: 30, name: 'rose 4' },
{ value: 28, name: 'rose 5' },
// 最重要的是下面這里
{ value: 0, itemStyle: { normal: { color: 'rgba(0,0,0,0)' } } },
{ value: 0, itemStyle: { normal: { color: 'rgba(0,0,0,0)' } } },
{ value: 0, itemStyle: { normal: { color: 'rgba(0,0,0,0)' } } },
{ value: 0, itemStyle: { normal: { color: 'rgba(0,0,0,0)' } } },
{ value: 0, itemStyle: { normal: { color: 'rgba(0,0,0,0)' } } }
],
z: -1,
},
{
name: 'Nightingale Chart',
type: 'pie',
radius: ['20%', '68%'],
center: ['50%', '50%'],
// 設(shè)置角度
startAngle: 180,
roseType: 'area',
hoverAnimation: false,
itemStyle: {
borderRadius: 0
},
labelLine: {
normal: {
show: false
}
},
label: {
show: false
},
data: [
{ value: 40, itemStyle: { color: 'rgba(255,255,255,0.68)' } },
{ value: 38, itemStyle: { color: 'rgba(255,255,255,0.68)' } },
{
value: 32,
name: 'rose 3',
itemStyle: { color: 'rgba(255,255,255,0.68)' }
},
{
value: 30,
name: 'rose 4',
itemStyle: { color: 'rgba(255,255,255,0.68)' }
},
{
value: 28,
name: 'rose 5',
itemStyle: { color: 'rgba(255,255,255,0.68)' }
},
// 最重要的是下面這里
{ value: 0, itemStyle: { normal: { color: 'rgba(0,0,0,0)' } } },
{ value: 0, itemStyle: { normal: { color: 'rgba(0,0,0,0)' } } },
{ value: 0, itemStyle: { normal: { color: 'rgba(0,0,0,0)' } } },
{ value: 0, itemStyle: { normal: { color: 'rgba(0,0,0,0)' } } },
{ value: 0, itemStyle: { normal: { color: 'rgba(0,0,0,0)' } } }
]
}
]
};

image.png