• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
小码哥-倩倩
博客园    首页    新随笔    联系   管理    订阅  订阅

自定义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

 

posted @ 2019-01-28 16:00  小码哥-倩倩  阅读(961)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3