常用配置
<!DOCTYPE html>
<html lang=''en'>
<head>
<meta charset='UTF-8'>
<meta name='viewport' content='width=device-width, initial-scale=1.0'>
<meta http-equiv='X-UA-Compatible' content=''ie=edge'>
<title>雷达图</title>
<script src='js/lib/echarts.min.js'></script>
</head>
<body>
<div style='width: 600px;height:600px'></div>
<script>
var mCharts = echarts.init(document.querySelector('div'))
var dataMax = [
{
name: '易用性',
max: 100
},
{
name: '功能',
max: 100
},
{
name: '拍照',
max: 100
},
{
name: '跑分',
max: 100
},
{
name: '续航',
max: 100
}
]
var option = {
radar:{
indicator:dataMax,
shape:'circle'
},
series:[
{
type:'radar',
label:{
show:true
},
areaStyle:{},
data:[
{
name:'华为手机',
value:[80,90,72,80,92]
},
{
name:'中兴手机',
value:[90,80,42,60,82]
}
]
}
]
}
mCharts.setOption(option)
</script>
</body>
</html>