blob: 56a93b09ae57022e9643236cc0159e78e09458d6 [file] [log] [blame]
/*
title: Customized Radar Chart
category: radar
titleCN: 自定义雷达图
difficulty: 2
*/
option = {
color: [ '#67F9D8', '#FFE434', '#56A3F1', '#FF917C'],
title: {
text: '自定义雷达图'
},
legend: {
data: ['Data A', 'Data B', 'Data C', 'Data D']
},
radar: [
{
indicator: [
{ text: '指标一' },
{ text: '指标二' },
{ text: '指标三' },
{ text: '指标四' },
{ text: '指标五' }
],
center: ['25%', '50%'],
radius: 120,
startAngle: 90,
splitNumber: 4,
shape: 'circle',
name: {
formatter: '【{value}】',
textStyle: {
color: '#428BD4'
}
},
splitArea: {
areaStyle: {
color: ['#77EADF', '#26C3BE', '#64AFE9', '#428BD4'],
shadowColor: 'rgba(0, 0, 0, 0.2)',
shadowBlur: 10
}
},
axisLine: {
lineStyle: {
color: 'rgba(211, 253, 250, 0.8)'
}
},
splitLine: {
lineStyle: {
color: 'rgba(211, 253, 250, 0.8)'
}
}
},
{
indicator: [
{ text: '语文', max: 150 },
{ text: '数学', max: 150 },
{ text: '英语', max: 150 },
{ text: '物理', max: 120 },
{ text: '化学', max: 108 },
{ text: '生物', max: 72 }
],
center: ['75%', '50%'],
radius: 120,
name: {
textStyle: {
color: '#fff',
backgroundColor: '#666',
borderRadius: 3,
padding: [3, 5]
}
}
}
],
series: [
{
name: '雷达图',
type: 'radar',
emphasis: {
lineStyle: {
width: 4
}
},
data: [
{
value: [100, 8, 0.40, -80, 2000],
name: 'Data A'
},
{
value: [60, 5, 0.30, -100, 1500],
name: 'Data B',
areaStyle: {
color: 'rgba(255, 228, 52, 0.6)'
}
}
]
},
{
name: '成绩单',
type: 'radar',
radarIndex: 1,
data: [
{
value: [120, 118, 130, 100, 99, 70],
name: 'Data C',
symbol: 'rect',
symbolSize: 12,
lineStyle: {
type: 'dashed'
},
label: {
show: true,
formatter: function (params) {
return params.value;
}
}
},
{
value: [100, 93, 50, 90, 70, 60],
name: 'Data D',
areaStyle: {
color: new echarts.graphic.RadialGradient(0.1, 0.6, 1, [
{
color: 'rgba(255, 145, 124, 0.1)',
offset: 0
},
{
color: 'rgba(255, 145, 124, 0.9)',
offset: 1
}
])
}
}
]
}
]
};