echarts 雷达图样式自定义 2018-12-13

export default function drawradar(basedata, all_data) {

    var Radar = {

        // title: {

        //    text: '基础雷达图'

        // },

   // 鼠标移入的悬浮框的样式

        tooltip: {

            backgroundColor:'#ffff',

            borderColor : '#eeee',

            borderRadius : 2,

            borderWidth: 1,

            textStyle : {

                color: '#5c6781',

                fontSize: 12,

            },

        },

        radar: {

        //  shape: 'circle',     // 雷达样式图,circle 雷达圆形样式

          name: {

          //  文本样式

            textStyle: {

              color: '#8992a7',

              backgroundColor: '#fff',

              fontSize:12,

              borderRadius: 3,

              padding: [3, 5]

            }

          },

       // 雷达图的5维度, 最大值100

          indicator: [

            { name: '运营能力', max: 100 },

            { name: '历史安全', max: 100 },

            { name: '已知风险', max: 100 },

            { name: '运行能力', max: 100 },

            { name: '网站环境', max: 100 }

          ],

          axisLine: {            // 坐标轴线

            show: true ,      // 默认显示,属性show控制显示与否

            lineStyle : {

              width : 1,

              color : '#eeeeee' // 图表背景网格线的颜色

          }

        },

        // 网格线的颜色

          splitLine : {

            show : true,

            lineStyle : {

                width : 1,

                color : '#eeeeee' // 图表背景网格线的颜色

            }

        }

        },

        series: [{

          // name: '预算 vs 开销(Budget vs spending)',

          symbol: 'none',    //去掉雷达图 的 拐点的圈

          type: 'radar',       // 类型

          areaStyle: {

          },

          data: [

            {

              value: basedata ,

              name: '总评分' + all_data,

              areaStyle: {

                type: 'default',

                opacity: 0.5,                       // 图表中各个图区域的透明度

                color: "rgb(255, 209 , 64)"   // 图表中各个图区域的颜色

            },

           // 雷达构成的区域边框 

            lineStyle: {

              color:'rgb(255, 218 , 29)', // 图表中各个图区域的边框线颜色

              opacity: 0.5,

            },

            }

          ]

        }]

      }

    return Radar

}

你可能感兴趣的:(echarts 雷达图样式自定义 2018-12-13)