这条线 --->
那么你需要在你的数据里面有 links 这个属性 这个属性里面 id参数就是正常的id, source : 是连接谁 ; target: 是要和谁连 (里面写data里面的id) ;
旁边列的标题------->
首先需要把 gantt.config.reorder_grid_columns 设置为true 然后 gantt.config.columns 里面写你的标题内容,这是一个数组;label是列显示的名字 ,width是宽度,这个列自带滚动条的,align是对齐的方式,resize是缩放的意思(可以参考下面的代码)
gantt.config.reorder_grid_columns = true;
gantt.config.columns = [{
name: "text",
label: "任务名",
width: 200,
align: "center",
tree: true,
resize: true
}, {
name: "start_date",
label: "开始日期",
width: 100,
align: "center",
resize: true
}, {
name: "duration",
label: "持续时间",
width: 100,
align: "center",
resize: true
}];
提示工具信息----->
gantt.templates.tooltip_text 这个函数 (参考下面的代码):
gantt.templates.tooltip_text = function (start, end, task) {
return "<b>订单:</b> " + task.text + "<br/><b>开始时间:</b> " + gantt.templates.tooltip_date_format(start) + "<br/><b>结束时间:</b> " + gantt.templates.tooltip_date_format(end);
};
进度条:function percenToString (参考代码)
function percenToString(num) {
return Math.floor(num * 100) + '%';
}
后面我编不出来了,代码都在上一篇博客里了,意思大概就是那么个意思,直接抄回去了慢慢改,觉得真香的给我点个赞,kkkkk!