option = { title: {text: '甘特图'}, name: '如何让绿色部分隐藏,只留下红色部分', tooltip: {}, dataset: { sourceHeader:false, dimensions: ['product', {name:'start', type:'time'}, {name:'end', type:'time'}], // 提供一份数据。 source: [ ['任务一', '2017-05-10', '2017-05-11'], ['任务二', '2017-05-12', '2017-05-14'], ['任务三', '2017-05-15', '2017-05-17'], ['任务四', '2017-05-19', '2017-05-20'] ] }, yAxis: {type: 'category'}, xAxis: { type:'time', min: '2017-05-01' }, series: [ { type:'bar', stack: '计划', encode: { y: 'product', x: 'end', }, label: { normal: { show: true, position: 'inside' } }, }, { type:'bar', stack: '计划', name: '辅助', data: [ '2017-05-10', '2017-05-12', '2017-05-15', '2017-05-19', ], itemStyle: { normal: { barBorderColor: 'rgba(0,0,0,0)', color: 'green' }, emphasis: { barBorderColor: 'rgba(0,0,0,0)', color: 'green' } }, } ] };