我正在使用vis.js时间线图表和右侧显示的所有项目内容。但是当某些内容包含大量文本时,并非所有内容都显示在图表上。我想知道 (1)如果无论如何都要计算内容长度并重置图表的宽度。 (2)如果可以让最后一组项目内容左对齐
感谢您的任何建议
问题是右侧的某些内容未显示在图表上 documentation
这是代码
var items = new vis.DataSet([
{id: 1, className:'item4', content: 'item 1', start: '2016-04-10'},
{id: 2, className:'item5', content: 'item 2', start: '2016-04-10'},
{id: 3, className:'item4', content: 'item 3', start: '2016-04-10'},
{id: 5, className:'item4', content: 'item 5', start: '2016-04-18'},
{id: 6, className:'item5', content: 'item 6', start: '2016-04-18'},
{id: 7, className:'item4', content: 'item 7', start: '2016-04-18'},
{id: 8, className:'item5', content: 'item 8', start: '2016-04-18'},
{id: 9, className:'item4', content: 'This item has long title', start: '2016-04-25'},
{id: 10, className:'item5', content: 'item 10', start: '2016-04-25'},
{id: 11, className:'item6', content: 'item 11', start: '2016-04-25'}
]);
var options = {
showCurrentTime: false,
align: 'left',
moveable: false,
orientation: {axis: 'both', item: 'top'},
height: 400,
margin: {
axis: 100
}
};
var timeline = new vis.Timeline(container, items, options);