开发者社区> 问答> 正文

echarts迁徙图动态加载数据,出现错误,求助

主要代码如下,不知是给的拼接数据错误还是什么问题。。报错和拼接后的数据在二楼截图

var geoCoord = {};
  var markPoint = new Array(); //{ name : '常州', value : 10 }
  var markLine = new Array(); //[ { name : '北京' }, { name : '长春', value : 40 }]
  $.ajax({
          url:fullpath + '/phone_poi_clusterController.do?queryCenter',
          type:'post', 
          dataType:'json', 
          success:function(json){
    $.each(json.rows,function(i,bean){ 
     var geo = new Array();
     var line = new Array();
     var points = new Array();
     
     geo.push(bean.latitude);
     geo.push(bean.longitude);
     line.push({'name':'祈福新村'});
     line.push({'name':bean.classification,'value':bean.count});
     
     points.push({'name':bean.classification});
     points.push({'value':bean.count});
     markPoint.push(points);
     markLine.push(line);
     geoCoord[bean.classification] = geo;
     
       });
  option = {
            color: ['gold','aqua','lime'],
            title : {
                text: '模拟迁徙',
                subtext:'数据纯属虚构',
                x:'center',
                textStyle : {
                    color: '#fff'
                }
            },
            tooltip : {
                trigger: 'item',
                formatter: function (v) {
                    return v[1].replace(':', ' > ');
                }
            },
            legend: {
                orient: 'vertical',
                x:'left',
                data:['祈福新村'],
                selectedMode: 'single',
                textStyle : {
                    color: '#fff'
                }
            },
            toolbox: {
                show : true,
                orient : 'vertical',
                x: 'right',
                y: 'center',
                feature : {
                    mark : {show: true},
                    dataView : {show: true, readOnly: false},
                    restore : {show: true},
                    saveAsImage : {show: true}
                }
            },
            dataRange: {
                min : 0,
                max : 100,
                x: 'right',
                calculable : true,
                color: ['#ff3333', 'orange', 'yellow','lime','aqua'],
                textStyle:{
                    color:'#fff'
                }
            },
            series : [
                {
                    name:'祈福新村',
                    type:'map',
                    mapType: 'none',
                    data:[],
                    geoCoord: geoCoord,

                    markLine : {
                        smooth:true,
                        effect : {
                            show: true,
                            scaleSize: 1,
                            period: 30,
                            color: '#fff',
                            shadowBlur: 10
                        },
                        itemStyle : {
                            normal: {
                                borderWidth:1,
                                lineStyle: {
                                    type: 'solid',
                                    shadowBlur: 10
                                }
                            }
                        },
                        data : markLine
                    },
                    markPoint : {
                        symbol:'emptyCircle',
                        symbolSize : function (v){
                            return 10 + v/10
                        },
                        effect : {
                            show: true,
                            shadowBlur : 0
                        },
                        itemStyle:{
                            normal:{
                                label:{show:false}
                            }
                        },
                        data : markPoint
                    }               
                }]
                };
    console.log(option);
    var myChart = BMapExt.initECharts(container);
       BMapExt.setOption(option);

展开
收起
a123456678 2016-07-13 15:44:40 3384 0
1 条回答
写回答
取消 提交回答
  • screenshot

    2019-07-17 19:55:43
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
函数计算最佳实践:快速开发一个分布式 Puppeteer 网页截图服务 立即下载
动态、高效,蚂蚁动态卡片的内核逻辑 立即下载
数据展现:可视化报表及嵌入应用 立即下载