Toggle navigation
进度条
By
晴天第二119
2017-11-17 09:46:57
脚本
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 startTime = '2001-05-03'; var endTime = '2007-05-02'; var currentTime = '2006-11-25'; var startDate = new Date(startTime.split('-')[0], startTime.split('-')[1], startTime.split('-')[2]); var endDate = new Date(endTime.split('-')[0], endTime.split('-')[1], endTime.split('-')[2]); var currentDate = new Date(currentTime.split('-')[0], currentTime.split('-')[1], currentTime.split('-')[2]); var es = endDate.getTime() - startDate.getTime(); var cs = currentDate.getTime() - startDate.getTime(); var payTime0 = '2002-11-11'; var payDate0 = new Date(payTime0.split('-')[0], payTime0.split('-')[1], payTime0.split('-')[2]); var p0_s = payDate0.getTime() - startDate.getTime(); var payTime1 = '2005-05-02'; var payDate1 = new Date(payTime1.split('-')[0], payTime1.split('-')[1], payTime1.split('-')[2]); var p1_s = payDate1.getTime() - startDate.getTime(); var payTime2 = '2006-08-22'; var payDate2 = new Date(payTime2.split('-')[0], payTime2.split('-')[1], payTime2.split('-')[2]); var p2_s = payDate2.getTime() - startDate.getTime(); var payTime3 = '2007-01-31'; var payDate3 = new Date(payTime3.split('-')[0], payTime3.split('-')[1], payTime3.split('-')[2]); var p3_s = payDate3.getTime() - startDate.getTime(); var progressValueC = Math.round((cs / es) * 100); var progressValue0 = Math.round((p0_s / es) * 100); var progressValue1 = Math.round((p1_s / es) * 100); var progressValue2 = Math.round((p2_s / es) * 100); var progressValue3 = Math.round((p3_s / es) * 100); option = { tooltip: { //formatter: '
点击
进度条上方的各个付款日点以确认该节点已付款成功', showContent: false, trigger: 'axis', axisPointer: { type: 'shadow', shadowStyle: { opacity: 0 } } }, xAxis: { min: startTime, type: 'time', show: false }, yAxis: { type: 'category', data: ['进度'], show: false }, series: [{ name: '计划开始时间', type: 'bar', barWidth: 20, stack: '总量', label: { normal: { show: true, position: 'insidRight' } }, markPoint: { symbol: 'diamond', symbolSize: 40, data: [{ coord: [startTime, '进度'], itemStyle: { normal: { color: '#666666' } } }] }, itemStyle: { normal: { barBorderColor: '#0000', color: '#0000' }, emphasis: { barBorderColor: '#0000', color: '#0000' } }, data: [startTime] }, { name: '进度0', type: 'bar', stack: '总量', label: { normal: { show: true, position: 'insideRight', formatter: progressValue0 + '%' } }, markPoint: { symbol: 'triangle', symbolOffset: [0, '80%'], symbolSize: 30, data: [{ coord: [payTime0, '进度'], itemStyle: { normal: { color: '#666666' } } }] }, itemStyle: { normal: { color: '#00D020', barBorderRadius: 4, shadowBlur: 7, shadowColor: '#00D020' }, //emphasis//#30E939 emphasis: { color: '#00D020', shadowBlur: 7, shadowColor: '#00D020' } }, data: [payTime0] }, { name: '进度1', type: 'bar', stack: '总量', label: { normal: { show: true, position: 'insideRight', formatter: progressValue1 + '%' } }, markPoint: { symbol: 'triangle', symbolOffset: [0, '80%'], symbolSize: 30, data: [{ coord: [payTime1, '进度'], itemStyle: { normal: { color: '#666666' } } }] }, itemStyle: { normal: { color: '#00D020', barBorderRadius: 4, shadowBlur: 7, shadowColor: '#00D020' }, //emphasis//#30E939 emphasis: { color: '#00D020', shadowBlur: 7, shadowColor: '#00D020' } }, data: [payTime1] }, { name: '进度2', type: 'bar', stack: '总量', label: { normal: { show: true, position: 'insideRight', formatter: progressValue2 + '%' } }, markPoint: { symbol: 'triangle', symbolOffset: [0, '80%'], symbolSize: 30, data: [{ coord: [payTime2, '进度'], itemStyle: { normal: { color: '#666666' } } }] }, itemStyle: { normal: { color: '#DD1111', barBorderRadius: 4, shadowBlur: 7, shadowColor: '#DD1111' }, emphasis: { color: '#EE3333', shadowBlur: 15, shadowColor: '#EE3333' } }, data: [payTime2] }, { name: '当前', type: 'bar', stack: '总量', label: { normal: { show: true, position: 'insideRight', formatter: progressValueC + '%' } }, markPoint: { symbol: 'pin', symbolOffset: [0, '-15%'], data: [{ coord: [currentTime, '进度'], itemStyle: { normal: { color: '#666666' } } }] }, itemStyle: { normal: { color: '#DD1111', barBorderRadius: 4, shadowBlur: 7, shadowColor: '#DD1111' }, emphasis: { color: '#EE3333', shadowBlur: 15, shadowColor: '#EE3333' } }, data: [currentTime] }, { name: '进度3', type: 'bar', stack: '总量', label: { normal: { show: true, position: 'insideRight', formatter: progressValue3 + '%' } }, markPoint: { symbol: 'triangle', symbolOffset: [0, '80%'], symbolSize: 30, data: [{ coord: [payTime3, '进度'], itemStyle: { normal: { color: '#666666' } } }] }, itemStyle: { normal: { color: '#007EBA', barBorderRadius: 4, shadowBlur: 7, shadowColor: '#007EBA' }, emphasis: { color: '#009EDA', shadowBlur: 15, shadowColor: '#009EDA' } }, data: [payTime3] }, { name: '计划结束时间', type: 'bar', stack: '总量', markPoint: { symbol: 'diamond', symbolSize: 40, data: [{ coord: [endTime, '进度'], itemStyle: { normal: { color: '#666666' } } }] }, itemStyle: { normal: { color: '#007EBA', barBorderRadius: 4, shadowBlur: 7, shadowColor: '#007EBA' }, emphasis: { color: '#009EDA', shadowBlur: 15, shadowColor: '#009EDA' } }, data: [endTime] }] };