Toggle navigation
历史记录回看
By
C***_
2018-09-04 10:14:41
脚本
16
21
作品使用的第三方脚本
http://gallery.echartsjs.com/dep/echarts/map/js/china.js
数据管理
上传数据
支持小于 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 positions = { "data": { "cityDatas": [{ "symbolSize": 15, "name": "福州", "itemStyle": { "normal": { "color": "#F58158" } }, "value": [119.3, 26.08] }, { "symbolSize": 15, "name": "南宁", "itemStyle": { "normal": { "color": "#F58158" } }, "value": [108.33, 22.84] }, { "symbolSize": 15, "name": "成都", "itemStyle": { "normal": { "color": "#F58158" } }, "value": [104.06, 30.67] }, { "symbolSize": 15, "name": "济南", "itemStyle": { "normal": { "color": "#58B3CC" } }, "value": [117, 36.65] }, { "symbolSize": 15, "name": "上海", "itemStyle": { "normal": { "color": "#F58158" } }, "value": [121.48, 31.22] }, { "symbolSize": 15, "name": "重庆", "itemStyle": { "normal": { "color": "#58B3CC" } }, "value": [106.54, 29.59] }, { "symbolSize": 15, "name": "石家庄", "itemStyle": { "normal": { "color": "#F58158" } }, "value": [114.48, 38.03] }, { "symbolSize": 15, "name": "武汉", "itemStyle": { "normal": { "color": "#F58158" } }, "value": [114.31, 30.52] }, { "symbolSize": 15, "name": "广州", "itemStyle": { "normal": { "color": "#F58158" } }, "value": [113.23, 23.16] }, { "symbolSize": 15, "name": "哈尔滨", "itemStyle": { "normal": { "color": "#58B3CC" } }, "value": [126.63, 45.75] }, { "symbolSize": 15, "name": "天津", "itemStyle": { "normal": { "color": "#58B3CC" } }, "value": [117.2, 39.13] }, { "symbolSize": 15, "name": "西安", "itemStyle": { "normal": { "color": "#F58158" } }, "value": [108.95, 34.27] }, { "symbolSize": 15, "name": "郑州", "itemStyle": { "normal": { "color": "#F58158" } }, "value": [113.65, 34.76] }, { "symbolSize": 15, "name": "杭州", "itemStyle": { "normal": { "color": "#F58158" } }, "value": [120.19, 30.26] }, { "symbolSize": 15, "name": "太原", "itemStyle": { "normal": { "color": "#58B3CC" } }, "value": [112.53, 37.87] }, { "symbolSize": 15, "name": "北京", "itemStyle": { "normal": { "color": "#58B3CC" } }, "value": [116.46, 39.92] }], "tempCapitals": { "福州": [119.3, 26.08], "南宁": [108.33, 22.84], "成都": [104.06, 30.67], "济南": [117, 36.65], "上海": [121.48, 31.22], "重庆": [106.54, 29.59], "石家庄": [114.48, 38.03], "武汉": [114.31, 30.52], "广州": [113.23, 23.16], "哈尔滨": [126.63, 45.75], "天津": [117.2, 39.13], "西安": [108.95, 34.27], "郑州": [113.65, 34.76], "杭州": [120.19, 30.26], "太原": [112.53, 37.87], "北京": [116.46, 39.92] }, "Rows": { "山东": 28, "福建": 20, "上海": 10, "山西": 24, "四川": 30, "河北": 25, "河南": 26, "广西": 13, "浙江": 36, "重庆": 30, "湖北": 27, "黑龙江": 20, "广东": 30, "天津": 12, "陕西": 19, "北京": 15 } }, "message": "请求成功", "status": 0 } var historyTraceLookData = positions['data']['Rows'] || [] console.info(historyTraceLookData) var cityDatas = positions['data']['cityDatas'] || [] var moveLines = [] var gap = parseInt(cityDatas.length / 2) - 1 for (var i = 0; i < cityDatas.length; i++) { cityDatas[i]['symbolSize'] = 8 for (var j = 0; (j < cityDatas.length && j < gap); j++) { if (cityDatas[i]['name'] !== cityDatas[j]['name']) { moveLines.push({ 'fromName': cityDatas[i]['name'], 'toName': cityDatas[j]['name'], 'coords': [cityDatas[i]['value'], cityDatas[j]['value']] }) } } } option = { backgroundColor: { type: 'linear', x: 0, y: 0, x2: 0, y2: 1, colorStops: [{ offset: 0, color: '#404353' // 0% 处的颜色 }, { offset: 1, color: '#22242A' // 100% 处的颜色 }], globalCoord: false // 缺省为 false }, title: { text: '历史记录回看', left: 'center', top: 'top', textStyle: { fontSize: 15, color: 'rgba(255,255,255, 0.9)' } }, geo: { map: 'china', label: { normal: { show: true, fontSize: 8 }, emphasis: { show: true, fontSize: 8 } }, itemStyle: { normal: { areaColor: '#323c48', borderColor: '#111' }, emphasis: { areaColor: '#2a333d' } } }, series: [{ name: '地点', type: 'effectScatter', coordinateSystem: 'geo', zlevel: 2, rippleEffect: { brushType: 'stroke' }, label: { emphasis: { show: true, position: 'right', formatter: '{b}' } }, symbolSize: 2, showEffectOn: 'render', itemStyle: { normal: { color: '#46bee9' } }, data: cityDatas }, { name: '线路', type: 'lines', coordinateSystem: 'geo', zlevel: 2, large: true, effect: { show: true, constantSpeed: 30, symbol: 'pin', symbolSize: 3, trailLength: 0 }, lineStyle: { normal: { color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ offset: 0, color: '#58B3CC' }, { offset: 1, color: '#F58158' }], false), width: 2, opacity: 0.2, curveness: 0.1 } }, data: moveLines }] };