3,479
个编辑
第14行: | 第14行: | ||
} | } | ||
appendCSS(); | appendCSS(); | ||
$(document).ready(function() { | |||
const container = document.getElementById("visualization"); | |||
// 解析项目和日期 | |||
const itemsArray = $("#visualization").data("items").split(";"); | |||
const items = new vis.DataSet(itemsArray.map((item, index) => { | |||
const [content, start] = item.split(","); | |||
return { id: index + 1, content: content.trim(), start: start.trim() }; | |||
})); | |||
// Configuration for the Timeline | |||
const options = {}; | |||
// Create a Timeline | |||
const timeline = new vis.Timeline(container, items, options); | |||
}); |