效果见图
关键字
axisLabel,false不展示,true展示
效果
整段代码如下
option = {
title: {
text: '基础雷达图'
},
legend: {
data: ['预算分配(Allocated Budget)', '实际开销(Actual Spending)']
},
radar: {
// 注意下面这段,label写到每个indicator里面
indicator:[
{ name: '销售(Sales)', max: 6500,},
{ name: '管理(Administration)', max: 16000,axisLabel:{show:false}},
{ name: '信息技术(Information Technology)', max: 30000,axisLabel:{show:false}},
{ name: '客服(Customer Support)', max: 38000,axisLabel:{show:false}},
{ name: '研发(Development)', max: 52000,axisLabel:{show:false}},
{ name: '市场(Marketing)', max: 25000,axisLabel:{show:false}}
],
axisLabel:{
show:true,
color:'#333',
showMinLabel: false,
},
},
series: [{
name: '预算 vs 开销(Budget vs spending)',
type: 'radar',
data: [
{
value: [5000, 14000, 28000, 26000, 42000, 21000],
name: '实际开销(Actual Spending)'
}
]
}]
};
如果需要全部展示,可以把label拎出来放到外面,代码和效果如下
option = {
title: {
text: '基础雷达图'
},
legend: {
data: ['预算分配(Allocated Budget)', '实际开销(Actual Spending)']
},
radar: {
// shape: 'circle',
indicator:[
{ name: '销售(Sales)', max: 6500,},
{ name: '管理(Administration)', max: 16000,},
{ name: '信息技术(Information Technology)', max: 30000,},
{ name: '客服(Customer Support)', max: 38000,},
{ name: '研发(Development)', max: 52000,},
{ name: '市场(Marketing)', max: 25000}
],
axisLabel:{
show:true,
color:'#333',
showMinLabel: false,
},
},
series: [{
name: '预算 vs 开销(Budget vs spending)',
type: 'radar',
data: [
{
value: [5000, 14000, 28000, 26000, 42000, 21000],
name: '实际开销(Actual Spending)'
}
]
}]
};