如何添加使用echats地图悬浮显示内容

/初始化绘制全国地图配置
var option = {
    backgroundColor: '#000',
    title: {
        text: 'Echarts3 中国地图农村金融',
        subtext: '三级科技下乡',
        link: 'http://www.cnblogs.com/sxz2008/',
        left: 'center',
        textStyle: {
            color: '#fff',
            fontSize: 16,
            fontWeight: 'normal',
            fontFamily: "Microsoft YaHei"
        },
        subtextStyle: {
            color: '#ccc',
            fontSize: 13,
            fontWeight: 'normal',
            fontFamily: "Microsoft YaHei"
        }
    },
    tooltip: {        //显示悬浮窗口
        trigger: 'item',
//使用这个函数返回悬浮内容 formatter:function(params){ //定义一个res变量来保存最终返回的字符结果,并且先把地区名称放到里面 // var res='随机数字'+'<br />'; var res=params.name+':'+'随机数字'+'<br />'; var myseries=provinces;//省市区 for(var i=0;i<myseries.length;i++){ if(myseries[i].name==params.name){ res+=myseries[i].name+':'+myseries[i].value+'<br />'; } }
        //市区 for(var j=0;j<city.length;j++){ if(city[j].name==params.name){ res+=city[j].name+':'+city[j].value+'<br />'; } }
        //县区 for(var k=0;k<area.length;k++){ if(area[k].name==params.name){ res+=area[k].name+':'+area[k].value+'<br />'; } } return res; }, }, toolbox: { show: true, orient: 'vertical', left: 'right', top: 'center', feature: { dataView: { readOnly: false }, restore: {}, saveAsImage: {} }, iconStyle: { normal: { color: '#fff' } } }, visualMap: { type: 'continuous', // 连续型 min: 0, // 值域最小值,必须参数 max: 1200, // 值域最大值,必须参数 calculable: true, // 是否启用值域漫游 inRange: { color: ['#50a3ba', '#eac736', '#d94e5d'] // 指定数值从低到高时的颜色变化 }, textStyle: { color: '#fff' // 值域控件的文本颜色 } }, animationDuration: 1000, animationEasing: 'cubicOut', animationDurationUpdate: 1000 };

使用echarts.js 改造git项目能够省市区显示具体内容;主要是json数据和formatter函数返回的值