Toggle navigation
桑基图颜色设置
By
l***9
2019-07-02 08:16:11
脚本
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 population= [ {"source": "惠城区", "target": "商服用地", "value": 712359.3}, {"source": "惠城区", "target": "商住用地", "value": 12500.2}, {"source": "惠城区", "target": "科教用地", "value": 50241.4}, {"source": "惠城区", "target": "仓储用地", "value": 42212.9}, {"source": "惠城区", "target": "工业用地", "value": 180555.06}, {"source": "惠城区", "target": "其他用地", "value": 8560.2}, {"source": "仲恺区", "target": "商服用地", "value": 618180.6}, {"source": "仲恺区", "target": "商住用地", "value": 436696.23}, {"source": "仲恺区", "target": "科教用地", "value": 213535}, {"source": "仲恺区", "target": "工业用地", "value": 1856227.4}, {"source": "惠阳区", "target": "商服用地", "value": 8950}, {"source": "惠阳区", "target": "商住用地", "value": 177577.6}, {"source": "惠阳区", "target": "工业用地", "value": 523499}, {"source": "惠阳区", "target": "其他用地", "value": 110113}, {"source": "大亚湾", "target": "商服用地", "value": 145857}, {"source": "大亚湾", "target": "商住用地", "value": 413287.5}, {"source": "大亚湾", "target": "住宅用地", "value": 73910.8}, {"source": "大亚湾", "target": "工业用地", "value": 442695}, {"source": "大亚湾", "target": "其他用地", "value": 2764.4}, {"source": "博罗县", "target": "商服用地", "value": 134172}, {"source": "博罗县", "target": "商住用地", "value": 294527}, {"source": "博罗县", "target": "住宅用地", "value": 6851}, {"source": "博罗县", "target": "科教用地", "value": 121422}, {"source": "博罗县", "target": "工业用地", "value": 989856.58}, {"source": "博罗县", "target": "其他用地", "value": 9134}, {"source": "惠东县", "target": "商服用地", "value": 33732.97}, {"source": "惠东县", "target": "商住用地", "value": 65556.41}, {"source": "惠东县", "target": "住宅用地", "value": 295348.5}, {"source": "惠东县", "target": "商业用地", "value": 7391.31}, {"source": "惠东县", "target": "工业用地", "value": 549721.16}, {"source": "龙门县", "target": "商服用地", "value": 146022.81}, {"source": "龙门县", "target": "住宅用地", "value": 146422.47}, {"source": "龙门县", "target": "商业用地", "value": 49587.21}, {"source": "龙门县", "target": "仓储用地", "value": 36218.96}, {"source": "龙门县", "target": "工业用地", "value": 267393.02}, {"source": "龙门县", "target": "其他用地", "value": 4131.95}, ] var city={ '惠城区':'#e9bae8', '仲恺区':'#3dc5e7', '惠阳区':'#2aa12d', '大亚湾':'#e88886', '博罗县':'#feda66', '惠东县':'#c92123', '龙门县':'#8bc77b', '商服用地':'#fb7f10', '商住用地':'#e492d0', '住宅用地':'#2aa12d', '商业用地':'#fb7f10', '科教用地':'#98c0fd', '仓储用地':'#4393c3', '工业用地':'#2166ac', '其他用地':'#f97494', } var citylist=[]; //遍历city for(var key in city){ citylist.push( {name: key,itemStyle: {normal: {color:city[key]}}} //构造节点对象,包括name和itemStyle ) } console.log(citylist) var data=[]; for(var i=0;i