需求
Highcharts 甘特图使用数据点的依赖属性来确定依赖任务之间的关系,并在它们之间绘制箭头。注意,在存在多个依赖项的情况下,依赖项属性也采用Array<String|Object>
分析与解决
定义依赖项的代码示例:
Highcharts.ganttChart('container', {
title: {
text: 'Simple Gantt Chart'
},
series: [{
name: 'Project 1',
data: [{
id: 's',
name: 'Start prototype',
start: Date.UTC(2014, 10, 18),
end: Date.UTC(2014, 10, 20)
}, {
id: 'b',
name: 'Develop',
start: Date.UTC(2014, 10, 20),
end: Date.UTC(2014, 10, 25),
dependency: 's'
}, {
id: 'a',
name: 'Run acceptance tests',
start: Date.UTC(2014, 10, 23),
end: Date.UTC(2014, 10, 26)
}, {
name: 'Prototype finished',
start: Date.UTC(2014, 10, 27),
end: Date.UTC(2014, 10, 29),
dependency: ['a', 'b'],
milestone: true
}]
}]
});
效果图:
希望这些信息对大家有所帮助!如果您有任何其他问题,请随时提问。
标签:UTC,依赖,name,10,甘特图,start,Date,2014,Highcharts From: https://blog.51cto.com/u_15674553/9071438