option = { title: { text: '项目实施进度表', left: 10 }, legend: { y: 'bottom', data: ['计划时间', '实际时间'] //修改的地方1 }, grid: { containLabel: true, left: 20 }, xAxis: { type: 'time' }, yAxis: { data: ['任务一', '任务二', '任务三', '任务四', '任务五', '任务六', '任务七'] }, tooltip: { trigger: 'axis', formatter: function(params) { var res = params[0].name + "</br>" var date0 = params[0].data; return date0; } }, series: [ { name: '计划开始时间', type: 'bar', stack: 'test1', itemStyle: { normal: { color: 'rgba(0,0,0,0)' } }, data: [ new Date('2019/3/9'), new Date('2019/3/10'), new Date('2019/3/11'), new Date('2019/3/12'), new Date('2019/3/13'), new Date('2019/3/14'), new Date('2019/3/15') ] }, { name: '计划时间', type: 'bar', stack: 'test1', //修改地方2 itemStyle: { normal: { color: '#F98563' } }, data: [ new Date('2019/3/12'), new Date('2019/3/13'), new Date('2019/3/14'), new Date('2019/3/15'), new Date('2019/3/16'), new Date('2019/3/17'), new Date('2019/3/18') ] }, { name: '实际开始时间', type: 'bar', stack: 'test2', itemStyle: { normal: { color: 'rgba(0,0,0,0)' } }, data: [ new Date('2019/3/12'), new Date('2019/3/13'), new Date('2019/3/14'), new Date('2019/3/15'), new Date('2019/3/16'), new Date('2019/3/17'), new Date('2019/3/18') ] }, { name: '实际时间', type: 'bar', stack: 'test2', //修改地方3 itemStyle: { normal: { color: '#A2E068' } }, data: [ new Date('2019/3/22'), new Date('2019/3/23'), new Date('2019/3/24'), new Date('2019/3/25'), new Date('2019/3/26'), new Date('2019/3/27'), new Date('2019/3/28') ] } ] };