Echarts图表之雷达图(一)

 <!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <title>Echarts图表</title>
        <!-- 引入echarts.min.js -->
        <script src="https://cdn.staticfile.org/echarts/4.3.0/echarts.min.js"></script>
    </head>
    <body>
        <div id="main" style="width: 600px;height:400px;"></div>
        <script type="text/javascript">
            var myChart = echarts.init(document.getElementById('main'));
            option = {
                color: ['#f1ff00', '#00c1ff', '#61a0a8', '#d48265', '#91c7ae', '#749f83', '#ca8622', '#bda29a', '#6e7074','#546570', '#c4ccd3'],
                backgroundColor: 'rgba(1,202,217,.2)',
                grid: {
                    left: 20,
                    right: 20,
                    top: 30,
                    bottom: 30
                },
                //雷达坐标系
                radar: {
                    name: {
                        textStyle: {
                            fontSize: 10,
                            color: 'rgba(255,255,255,.8)'
                        }
                    },
                    splitLine: {
                        lineStyle: {
                            color: [
                                'rgba(1,202,217,.01)', 'rgba(1,202,217,.01)'
                            ].reverse()
                        }
                    },
                    splitArea: {
                        show: false
                    },
                    axisLine: {
                        lineStyle: {
                            color: 'rgba(1,202,217,.7)'
                        }
                    },
                    //雷达图的指示器,用来指定雷达图中的多个变量(维度)
                    indicator: [{
                            name: '红色警情',
                            max: 6500
                        },
                        {
                            name: '橙色警情',
                            max: 16000
                        },
                        {
                            name: '黄色警情',
                            max: 30000
                        },
                        {
                            name: '绿色警情',
                            max: 44000
                        }
                    ]
                },
                series: [{
                    name: '',
                    // 类型:雷达图
                    type: 'radar',
                    radius: [5, 100],
                    center: ['50%', '50%'],
                    data: [{
                            value: [4300, 10000, 28000, 19000],
                            name: ''
                        },
                        {
                            value: [5000, 14000, 22000, 41000],
                            name: ''
                        }
                    ]
                }]
            };
            myChart.setOption(option);
        </script>
    </body>
</html>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值