echarts地图动画和java_echarts 实现中国地图

实现效果如下

c2e78693a0de

地图

//初始化echarts实例

var myChart = echarts.init(document.getElementById('main'));

//使用制定的配置项和数据显示图表

myChart.setOption(

{

//提示框组件

tooltip: {

show: false,//是否显示组件

trigger: 'item',//数据触发类型 item:数据图饼图触发 axis:坐标轴触发

formatter: '{b}'//地图 {b}(区域名称)

},

series: [{

name: '中国',

type: 'map',

mapType: 'china',

//selectedMode: 'multiple',

itemStyle: {//有2个状态 normal 是图形在默认状态下的样式;emphasis 是图形在高亮状态下的样式

normal: {

label: {

show: true,

textStyle: {//标签的文本样式

fontSize: 18,

color: '#000'

}

},

borderColor: '#cdcdca',//边框颜色

borderWidth: 0.5,//边框线宽

areaStyle: {//区域样式

color: '#000'

}

},

emphasis: {

borderWidth: 0.5,

borderColor: '#cdcdca',

areaColor: '#fff',

label: {

shadowColor: '#000', //默认透明

shadowBlur: 10,

show: true,

textStyle: {

fontSize: 12,

color: '#3db77f'

}

}

}

},

label: {

normal: {

show: false,

},

emphasis: {

show: false,

}

},

data: [{

name: '黑龙江',

itemStyle: {

normal: {

areaColor: "#f2e9e4",

// borderWidth: 2

},

emphasis: {//高亮状态下的多边形和标签样式

borderWidth: 1,

borderColor: '#3db77f',

areaColor: '#fff',

label: {

shadowColor: '#000', //默认透明

shadowBlur: 10,

show: true,

textStyle: {

fontSize: 12,

color: '#3db77f'

}

}

}

},

label: {

normal: {

show: true,

textStyle: {

fontSize: 12,

color: '#0d6fb8'

}

},

emphasis: {

show: true,

color: '#3db77f'

}

}

}, {

name: '青海',

itemStyle: {

normal: {

areaColor: "#f2e9e4",

// borderWidth: 2

},

emphasis: {

// borderWidth: 1,

// borderColor: '#3db77f',

areaColor: '#f2e9e4',

label: {

shadowColor: '#000', //默认透明

shadowBlur: 10,

show: false,

textStyle: {

fontSize: 12,

color: '#3db77f'

}

}

}

}

}, {

name: '陕西',

itemStyle: {

normal: {

areaColor: "#f2e9e4",

// borderWidth: 2

},

emphasis: {

borderWidth: 1,

borderColor: '#3db77f',

areaColor: '#fff',

label: {

shadowColor: '#000', //默认透明

shadowBlur: 10,

show: true,

textStyle: {

fontSize: 12,

color: '#3db77f'

}

}

}

},

label: {

normal: {

show: true,

textStyle: {

fontSize: 12,

color: '#0d6fb8'

}

},

emphasis: {

show: true,

color: '#3db77f'

}

}

}, {

name: '广东',

itemStyle: {

normal: {

areaColor: "#f2e9e4",

// borderWidth: 2

},

emphasis: {

// borderWidth: 1,

// borderColor: '#3db77f',

areaColor: '#f2e9e4',

label: {

shadowColor: '#000', //默认透明

shadowBlur: 10,

show: false,

textStyle: {

fontSize: 12,

color: '#3db77f'

}

}

}

}

}, {

name: '广西',

itemStyle: {

normal: {

areaColor: "#daeadd",

// borderWidth: 2

},

emphasis: {

// borderWidth: 1,

// borderColor: '#3db77f',

areaColor: '#daeadd',

label: {

shadowColor: '#000', //默认透明

shadowBlur: 10,

show: false,

textS

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值