Toggle navigation
湖北省各市区人数图
By
惊蜗牛梦
2018-10-28 07:57:06
脚本
16
21
作品使用的第三方脚本
数据管理
上传数据
支持小于 5M 任意格式(csv, xlsx, json, xml, ...)的数据文件
上传后可以通过生成的文件链接异步获取托管的数据。
历史数据
0 条
无历史数据
代码修改记录
信息提示
保存作品
对当前截图不满意?你还可以
上传本地截图
重新截图
作品名称
作品描述
标签
geo
grid
legend
markLine
markPoint
bar
effectScatter
line
lines
map
timeline
title
toolbox
tooltip
visualMap
作品默认版本
最新
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
20:11:45
图表已生成
整理代码
刷新
代码
var hubei = "/asset/get/s/data-1540713015397-Gt6McqKps.json"; var hData = ["恩施土家族苗族自治州", "十堰市", "宜昌市", "襄樊市", "黄冈市", "荆州市", "荆门市", "咸宁市", "随州市", "孝感市", "武汉市", "黄石市", "神农架林区", "天门市", "仙桃市", "潜江市", "鄂州市"] $.getJSON(hubei, (geoJSON) => { echarts.registerMap('HUBEI', geoJSON); option = { backgroundColor: '#012D63', tooltip: { trigger: 'item', formatter: '{b}\n{c} (p / km2)' }, textStyle: { fontFamily: 'monospace', fontSize: 'bold' }, geo: { map: 'HUBEI', left: 0, right: 0, top: 0, bottom: 0, selectedMode: 'single', label: { normal: { show: false, color: '#4abcee' }, emphasis: { show: false, color: '#fff' } }, itemStyle: { normal: { areaColor: 'rgba(0, 0, 0, 0)', borderColor: '#8dd4f2', borderWidth: '2', opacity: 1 }, emphasis: { areaColor: { type: 'linear', x: 0, y: 0, x2: 0, y2: 1, colorStops: [{ offset: 0, color: '#19406b' }, { offset: 1, color: '#3773bb' }], globalCoord: false }, opacity: 1 } } }, visualMap: { show: false, inRange: { color: ['rgba(0, 0, 0, 0)'] } }, series: [{ name: '湖北省', type: 'scatter', symbolSize: 0.1, label: { normal: { show: true, color: '#4abcee', formatter: (param) => { return '{a|' + param.name + '}\n{b|' + (param.value[2] || '') + '}' }, rich: { a: { fontFamily: 'Zapfino', fontSize: '70%', fontWeight: 'normal', fontStretch: 'normal', letterSpacing: '1px', color: '#8dd4f2', opacity: 0.8, align: 'center' }, b: { fontFamily: 'Zapfino', fontSize: '80%', fontWeight: 'normal', fontStretch: 'normal', letterSpacing: '2px', color: '#deff00', align: 'center' } } }, emphasis: { show: true, color: '#fff', formatter: (param) => { return '{a|' + param.name + '}\n{b|' + (param.value[2] || '') + '}' }, rich: { a: { fontFamily: 'MicrosoftYaHei-Bold', fontSize: '12px', fontWeight: 'normal', fontStretch: 'normal', letterSpacing: '1px', color: '#8dd4f2', opacity: 0.8, align: 'center' }, b: { fontFamily: 'DS-Digital-Bold', fontSize: '16px', fontWeight: 'normal', fontStretch: 'normal', letterSpacing: '2px', color: '#deff00', align: 'center' } } } }, coordinateSystem: 'geo', data: (()=>{ return geoJSON.features.map(e => { let name = e.properties.name return { name: name, value: e.properties.cp.concat(Math.floor(Math.random()*1000)) } }) })() }] } myChart.setOption(option) })