如何对齐vis线条和左侧

时间:2016-02-28 01:11:15

标签: javascript vis.js vis.js-timeline

我需要使vis-line更大(如10px),vis-box也保持10px,这样vis线和vis-box可以正确对齐,就像一条垂直线

.vis-item.vis-line { 
  position: absolute; 
  border-width: 10px; 
  border-color: red; 
}

.vis-item.vis-box {
   border-width: 1;
   text-align: left !important;
   background-color: transparent !important;
   border-left-width: 10px;
   border-color: red;
}

var container = document.getElementById('visualization');

var items = new vis.DataSet([
 {id: 4, className:'item4', content: 'item 4', start: '2016-01-16'},
 {id: 5, className:'item5', content: 'item 5', start: '2016-02-23'},
 {id: 6, className:'item6', content: 'item 6', start: '2016-03-27'}
 ]);

 var options = {
// showCurrentTime: true,
 align: 'left',
 orientation: {axis: 'both', item: 'top'}, 
 height: 400,
 margin: {
     axis: 100
}
};
var timeline = new vis.Timeline(container, items, options);

请参阅网址https://jsfiddle.net/gbdjbdhv/4/,但是vis线距离vis-box左侧5px。我需要有关如何使vis线和vis-box左侧垂直对齐的建议。

1 个答案:

答案 0 :(得分:0)

这将在第一个下一版本中修复,请参阅https://github.com/almende/vis/pull/1695