Echarts雷达图异步加载数据实例

      function fetchData(cb) {
    setTimeout(function () {
        cb({
            data:  [10, 89, 100, 90, 98, 90]
        });
    }, 1000);
}

option = {
    title : {
        text: '家庭诚信值',
        subtext: '完全家庭数据'
    },
    tooltip : {
        trigger: 'axis'
    },
    legend: {
        x : 'center',

        data:['张三']
    },
        symbolList:[ 
    'circle', 'rectangle', 'triangle', 'diamond', 
    'emptyCircle', 'emptyRectangle', 'emptyTriangle', 'emptyDiamond' 
],
  color:['blue','purple','gray'],
    toolbox: {
        show : true,
        feature : {
            mark : {show: true},
            dataView : {show: true, readOnly: false},
            restore : {show: true},
            saveAsImage : {show: true}
        }
    },
    calculable : true,
    polar : [
        {
            indicator : [
                {text : '诚实', max  : 100},
                {text : '规律', max  : 100},
                {text : '体能', max  : 100},
                {text : '爱好', max  : 100},
                {text : '力量', max  : 100},
                {text : '技能', max  : 100}
            ],
            radius : 120
        }
    ],
  //color:['red','green'],
    series : [
        {
            name: '完全实况球员数据',
            type: 'radar',
            itemStyle: {
                normal: {
                    areaStyle: {
                        type: 'default'
                    }
                }
            },
            data : [
                {
                    value : [],
                    name : '张三'
                }
            ]
        }
    ]
};

fetchData(function (data) {
    myChart.setOption({
        series: [{
                 data : [
                {
                    value: data.data,
                }
            ] 
        }]
    });
});
              
发布了81 篇原创文章 · 获赞 14 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/weixin_41290949/article/details/94913036