javascripttimelinevis.js

Is it possible to add a single item to a vis.js timeline?


I'd like to add a single item to a vis.js timeline, but this doesn't seem to be possible. The closest I can get is setItems, which replaces everything in the timeline with the new items. Is there a way to non-destructively add a new item?


Solution

  • For me this worked:

    timeline.itemsData.add(myItem);