Toggle navigation
测试
By
wei笑_
2017-07-25 09:14:47
脚本
16
21
作品使用的第三方脚本
https://lodash.com/vendor/cdn.jsdelivr.net/lodash/4.17.4/lodash.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 originData = [ { income: 20078, strategyName: '其他', stage: '01', y: '初步接触', strategy: '00' }, { income: 4760, strategyName: '其他', stage: '02', y: '沟通建议', strategy: '00' }, { income: 18050, strategyName: '其他', stage: '03', y: '方案设计', strategy: '00' }, { income: 4494.5, strategyName: '其他', stage: '04', y: '立项审批', strategy: '00' }, { income: 2540, strategyName: '其他', stage: '05', y: '投标阶段', strategy: '00' }, { income: 104.7, strategyName: '其他', stage: '06', y: '签约阶段', strategy: '00' }, { income: 574, strategyName: '其他', stage: '07', y: '合同执行', strategy: '00' }, { income: 1160, strategyName: '公开招投标', stage: '01', y: '初步接触', strategy: '01' }, { income: 6330, strategyName: '公开招投标', stage: '02', y: '沟通建议', strategy: '01' }, { income: 27820, strategyName: '公开招投标', stage: '03', y: '方案设计', strategy: '01' }, { income: 17813.9, strategyName: '公开招投标', stage: '04', y: '立项审批', strategy: '01' }, { income: 10480, strategyName: '公开招投标', stage: '05', y: '投标阶段', strategy: '01' }, { income: 2075.5, strategyName: '公开招投标', stage: '06', y: '签约阶段', strategy: '01' }, { income: 5889.4, strategyName: '公开招投标', stage: '07', y: '合同执行', strategy: '01' }, { income: 0, strategyName: '邀标', stage: '07', y: '合同执行', strategy: '02' }, { income: 0, strategyName: '邀标', stage: '01', y: '初步接触', strategy: '02' }, { income: 0, strategyName: '邀标', stage: '02', y: '沟通建议', strategy: '02' }, { income: 950, strategyName: '邀标', stage: '03', y: '方案设计', strategy: '02' }, { income: 45, strategyName: '邀标', stage: '04', y: '立项审批', strategy: '02' }, { income: 270, strategyName: '邀标', stage: '05', y: '投标阶段', strategy: '02' }, { income: 128, strategyName: '邀标', stage: '06', y: '签约阶段', strategy: '02' }, { income: 0, strategyName: '单一来源采购', stage: '01', y: '初步接触', strategy: '03' }, { income: 0, strategyName: '单一来源采购', stage: '02', y: '沟通建议', strategy: '03' }, { income: 2338, strategyName: '单一来源采购', stage: '03', y: '方案设计', strategy: '03' }, { income: 80, strategyName: '单一来源采购', stage: '04', y: '立项审批', strategy: '03' }, { income: 1085, strategyName: '单一来源采购', stage: '05', y: '投标阶段', strategy: '03' }, { income: 406, strategyName: '单一来源采购', stage: '06', y: '签约阶段', strategy: '03' }, { income: 298, strategyName: '单一来源采购', stage: '07', y: '合同执行', strategy: '03' }, { income: 0, strategyName: '竞争性谈判', stage: '04', y: '立项审批', strategy: '04' }, { income: 0, strategyName: '竞争性谈判', stage: '05', y: '投标阶段', strategy: '04' }, { income: 0, strategyName: '竞争性谈判', stage: '06', y: '签约阶段', strategy: '04' }, { income: 0, strategyName: '竞争性谈判', stage: '01', y: '初步接触', strategy: '04' }, { income: 100, strategyName: '竞争性谈判', stage: '02', y: '沟通建议', strategy: '04' }, { income: 200, strategyName: '竞争性谈判', stage: '03', y: '方案设计', strategy: '04' }, { income: 33.7, strategyName: '竞争性谈判', stage: '07', y: '合同执行', strategy: '04' }, { income: 0, strategyName: '询价', stage: '01', y: '初步接触', strategy: '05' }, { income: 0, strategyName: '询价', stage: '02', y: '沟通建议', strategy: '05' }, { income: 0, strategyName: '询价', stage: '03', y: '方案设计', strategy: '05' }, { income: 0, strategyName: '询价', stage: '04', y: '立项审批', strategy: '05' }, { income: 0, strategyName: '询价', stage: '05', y: '投标阶段', strategy: '05' }, { income: 0, strategyName: '询价', stage: '06', y: '签约阶段', strategy: '05' }, { income: 0, strategyName: '询价', stage: '07', y: '合同执行', strategy: '05' }, { income: 0, strategyName: '政府补贴', stage: '05', y: '投标阶段', strategy: '06' }, { income: 0, strategyName: '政府补贴', stage: '06', y: '签约阶段', strategy: '06' }, { income: 0, strategyName: '政府补贴', stage: '07', y: '合同执行', strategy: '06' }, { income: 0, strategyName: '政府补贴', stage: '01', y: '初步接触', strategy: '06' }, { income: 800, strategyName: '政府补贴', stage: '02', y: '沟通建议', strategy: '06' }, { income: 100, strategyName: '政府补贴', stage: '03', y: '方案设计', strategy: '06' }, { income: 6700, strategyName: '政府补贴', stage: '04', y: '立项审批', strategy: '06' }, { income: 0, strategyName: 'PPP', stage: '01', y: '初步接触', strategy: '07' }, { income: 0, strategyName: 'PPP', stage: '02', y: '沟通建议', strategy: '07' }, { income: 0, strategyName: 'PPP', stage: '03', y: '方案设计', strategy: '07' }, { income: 0, strategyName: 'PPP', stage: '04', y: '立项审批', strategy: '07' }, { income: 0, strategyName: 'PPP', stage: '05', y: '投标阶段', strategy: '07' }, { income: 0, strategyName: 'PPP', stage: '06', y: '签约阶段', strategy: '07' }, { income: 0, strategyName: 'PPP', stage: '07', y: '合同执行', strategy: '07' }, { income: 0, strategyName: '直接签约', stage: '01', y: '初步接触', strategy: '08' }, { income: 0, strategyName: '直接签约', stage: '02', y: '沟通建议', strategy: '08' }, { income: 0, strategyName: '直接签约', stage: '04', y: '立项审批', strategy: '08' }, { income: 536, strategyName: '直接签约', stage: '03', y: '方案设计', strategy: '08' }, { income: 500, strategyName: '直接签约', stage: '05', y: '投标阶段', strategy: '08' }, { income: 61.9, strategyName: '直接签约', stage: '06', y: '签约阶段', strategy: '08' }, { income: 40.2, strategyName: '直接签约', stage: '07', y: '合同执行', strategy: '08' } ]; var zeroSymbol = 'path://M275.4324649926712,11.016971593238729 L313.4325555220882,11.016971593238729 L313.4325555220882,383.0169422244129 L275.4324649926712,383.0169422244129 L275.4324649926712,11.016971593238729 z'; var symbol = 'diamond'; var yNames = []; var xNames = []; var seriesMap = {}; _.each(originData, function (item) { if (yNames.indexOf(item.y) < 0) { yNames.push(item.y); } if (xNames.indexOf(item.strategyName) < 0) { xNames.push(item.strategyName); } seriesMap[item.y] = seriesMap[item.y] || { name: item.y, dataMap: {} }; seriesMap[item.y].dataMap[item.strategyName] = item.income; }); var series = []; _.each(seriesMap, function (seriesItem) { var data = []; _.each(xNames, function (x) { var value = seriesItem.dataMap[x] || 0; var item = { name: seriesItem.name, value: [ xNames.indexOf(x), yNames.indexOf(seriesItem.name), value ] }; if (value <= 0) { item.symbol = zeroSymbol; item.symbolSize = [2,5]; item.itemStyle={ normal:{ color:'#517ed1' } } } data.push(item); }); series.push({ name: seriesItem.name, type: 'scatter', data: data, symbol: symbol, symbolSize: function (val) { return Math.pow(val[2], 0.25); } }); }); console.log(seriesMap); console.log(series); option = { title: { text: 'Punch Card of Github', link: 'https://github.com/pissang/echarts-next/graphs/punch-card' }, tooltip:{ show:true }, grid: { left: 2, bottom: 10, right: 10, containLabel: true }, xAxis: { type: 'category', data: xNames, boundaryGap: false, axisLine: { lineStyle:{ type:'dashed' } } }, yAxis: { type: 'category', data: yNames, axisLine: { lineStyle:{ type:'dashed' } } }, series: series };