自定义echart里边的样式技巧
雷达图的背景可以自定义
option = {
polar : [
{
indicator : [
{text : '文明指数:'+_this.allElevatorData.civilizationIndex,max:100},
{text : '运行指数:'+this.allElevatorData.runIndex,max:100},
{text : '维保指数:'+this.allElevatorData.maintenanceIndex,max:100},
{text : '安防指数:'+this.allElevatorData.securityIndex,max:100},
{text : '救援指数:'+this.allElevatorData.rescueIndex,max:100},
],
radius : 90, //雷达图的半径
splitNumber: 10, //背景圈数
shape:'circle',//设置雷达图背景样式
splitLine : {
show : false,
lineStyle : {
width : 1,
color : 'red' // 图表背景网格线的颜色
}
},
splitArea : {
show : true,
areaStyle : {
color: ["rgba(62,204,119,1)","rgba(62,204,119,0.8)",'rgba(62,204,119,0.6)','rgba(62,204,119,0.4)','rgba(62,204,119,0.2)'] // 图表背景网格区域的颜色 -> 从里到外
}
},
}
],
series : [
{
name: '完全实况球员数据',
type: 'radar',
itemStyle: {
normal: {
areaStyle: {
type: 'default',
color: 'rgba(0,255,48,0.6)',
}
}
},
data : [
{
value : [
_this.allElevatorData.civilizationIndex == 0 ? 100 :_this.allElevatorData.civilizationIndex ,
_this.allElevatorData.runIndex == 0 ? 100 :_this.allElevatorData.runIndex,
_this.allElevatorData.maintenanceIndex == 0 ? 100 :_this.allElevatorData.maintenanceIndex,
_this.allElevatorData.securityIndex == 0 ? 100 :_this.allElevatorData.securityIndex,
_this.allElevatorData.rescueIndex == 0 ? 100 :_this.allElevatorData.rescueIndex
],
name : '罗纳尔多',
itemStyle: {
normal: {
color : "#0CFF68" // 图表中各个图区域的边框线颜色
}
}
}
]
}
],
};
if (option && typeof option === "object") {
this.myChart.setOption(option, true);
}
原文链接参考:https://www.echartsjs.com/gallery/editor.html?c=radar-aqi
浙公网安备 33010602011771号