Toggle navigation
长沙市
By
z***t
2020-06-30 15:40:34
脚本
16
21
作品使用的第三方脚本
https://echarts.baidu.com/resource/echarts-gl-latest/dist/echarts-gl.min.js,https://gallery.echartsjs.com/asset/get/s/data-1566970916860-cwFZaRQbO.js,https://cdn.jsdelivr.net/npm/echarts@4.8.0/map/js/province/hunan.js,https://raw.githubusercontent.com/apache/incubator-echarts/4.8.0/dist/echarts.js,http://code.jquery.com/jquery-2.1.1.min.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 dt = [{ name: '芙蓉区', value: 40000.34, text: '贷款笔数:54412
贷款金额:468452.35万', selected: true }, { name: '岳麓区', value: 38000, text: '缴存人数:32412' }, { name: '开福区', value: 18000, text: '缴存人数:22412' }, { name: '天心区', value: 15092, text: '缴存人数:42412' }, { name: '雨花区', value: 28000, text: '缴存人数:52412' }, { name: '望城区', value: 12000, text: '缴存人数:72412' }, { name: '长沙县', value: 32000, text: '缴存人数:82412' }, { name: '宁乡市', value: 5100, text: '缴存人数:6412' }, { name: '浏阳市', value: 2200, text: '缴存人数:3412' }, { name: '分中心', value: 4918, text: '缴存人数:66412' } ]; var option = { title: { text: '长沙市', subtext: '各区县', x: 'center' }, tooltip: { trigger: 'item', type: 'cross', /* backgroundColor:"#ff7f50",//提示标签背景颜色 textStyle:{color:"#fff"}, //提示标签字体颜色 formatter:function(param){ return dt[param.dataIndex].name + "
" +dt[param.dataIndex].text; } */ alwaysShowContent: false, bordeRadius: 4, borderWidth: 1, borderColor: 'rgba(0,0,0,0.2)', backgroundColor: 'rgba(255,255,255,0.9)', padding: 0, // position: "top", textStyle: { fontSize: 12, color: '#333' }, formatter: function(params) { var color = "#FFB84D"; var a = "
" + dt[params.dataIndex].name + "
"; var num = Math.ceil(params.data.name[1].length / 10); a += "
"; for (var i = 0; i < num; i++) { a += dt[params.dataIndex].text + "
"; } a += "
"; return a; } }, visualMap: { min: 800, max: 50000, text: ['High', 'Low'], x: 'left', y: 'center', realtime: false, calculable: true, inRange: { color: ['lightskyblue', 'yellow', 'orangered'] } }, toolbox: { show: true, orient: 'vertical', x: 'right', y: 'center', borderColor: '#FFF', // 工具箱边框颜色 borderWidth: 0, // 工具箱边框线宽,单位px,默认为0(无边框) padding: 5, // 工具箱内边距,单位px,默认各方向内边距为5, showTitle: false, feature: { saveAsImage: { show: true, title: '保存为图片', type: 'jpeg' }, restore: { show: true }, } }, series: [{ name: '长沙', type: 'map', map: 'cs', // symbol:'../images/shine.jpg', // symbolSize: 41, roam: true, label: { normal: { show: true }, emphasis: { show: true } }, layoutCenter: ['50%', '50%'], //属性定义地图中心在屏幕中的位置,一般结合layoutSize 定义地图的大小 // layoutSize: 11200, itemStyle: { normal: { label: { show: true } }, emphasis: { label: { show: true } } }, data: dt }] }; $.get('https://geo.datav.aliyun.com/areas_v2/bound/430100_full.json', function(csJson) { echarts.registerMap('cs', csJson); var chart = echarts.init(document.getElementById('map')); chart.setOption(option); });