まず、私はあなたが言ったことを試してみましたが、それは仕事ではなく、まさに私が望む方法:私が望む何![enter image description here](https://i.stack.imgur.com/hZlZe.png)
が2つのタスクであるこのカントー動作するはずのような何か(タスク1、タスク2)を2つの異なる行に表示し、1行には表示しません。ここ はコードです:
var tab1 = [];
tab1[0] = "Task 1";
tab1[1] = "Task 2";
var tab2 = [];
tab2[0] = new Date("2017-04-04T00:00:00");
tab2[1] = new Date("2017-04-04T12:52:00");
var tab3 = [];
tab3[0] = new Date("2017-04-04T15:00:00");
tab3[1] = new Date("2017-04-06T06:00:00");
$(function() {
"use strict";
$(".gantt").gantt({
source: [{
name: "Sprint 0",
desc: "Analysis",
values: [{
from: "/Date("+c.getTime()+")/",
to: "/Date("+d.getTime()+")/",
label: "Requirement Gathering",
customClass: "ganttRed"
},{
from: "/Date("+a.getTime()+")/",
to: "/Date("+e.getTime()+")/",
label: "Scoping",
customClass: "ganttRed"
}]
},{
desc : "Tasks",
values: tab1.map(function(tab, index) {
return {
from: "/Date("+tab2[index].getTime()+")/",
to: "/Date("+tab3[index].getTime()+")/",
label: tab1,
customClass: "ganttRed"
}
})
}],
navigate: "scroll",
scale: "weeks",
maxScale: "months",
minScale: "hours",
itemsPerPage: 30,
useCookie: true,
onItemClick: function(data) {
alert("Item clicked - show some details");
},
onAddClick: function(dt, rowId) {
alert("Empty space clicked - add an item!");
},
onRender: function() {
if (window.console && typeof console.log === "function") {
console.log("chart rendered");
}
}
});
$(".gantt").popover({
selector: ".bar",
title: "I'm a popover",
content: "And I'm the content of said popover.",
trigger: "hover",
placement: "auto right"
});
prettyPrint();
});
はあなたの助け
いただきありがとうございます