2016-04-14 9 views
0

visタイムラインチャートの一番下に1つの特定のアイテムを配置する必要があります。 jqueryを使用して、アイテムがレンダリングされた後にチャートの下に移動できます。問題は、次のアイテムと重なる可能性があることです。他の項目も正しく整列されないことがあります。タイムラインで特定のアイテムをチャートの下に配置する方法と、すべてのアイテムが適切に配置されている

あなたのお手伝いをよろしくお願いいたします。

ここに感謝

コードあなたは2つのグループを使用して、あなたがしたい項目を入れることができます

https://jsfiddle.net/gbdjbdhv/28/

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

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: 13, className:'item4', content: 'item 5', start: '2016-04-16'}, 
    {id: 4, className:'likeToBeBottom', content: 'like to put this item at bottom', start: '2016-04-16'}, 
     {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: 'item 9', 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: true, 
      align: 'left', 
    orientation: {axis: 'both', item: 'top'}, 
    height: 400, 
    margin: { 
     axis: 100 
    } 
    }; 
    var timeline = new vis.Timeline(container, items, options); 
    if ($('.vis-current-time')){ 
     var height = $('.vis-current-time').height(); 
     $('div.vis-item.vis-box.likeToBeBottom').css({'top': height -180}); 
    } 

The problem is that the item I moved to bottom overlap with other items

[enter image description here]

答えて

0

ですベッド第2のグループの底部に表示される。グループを使用しているという事実を隠したい場合は、CSSを使用してグリッドを隠し、左側に表示されるグループラベルを隠すことができます。

関連する問題