ChrisK
ChrisK

Reputation: 44

How to set new options on timeline Vis.js when zooming in and out the timeline?

I wanted to know if there was a possiblity to set new options on the timeline when zooming in and out the timeline ?

In fact, i have elements that are stacked when i'm in month view, but when i'm in year view, i want them not to be stacked (set options stack: false on the timeline).

Is it somehow possible to know in which view we are and to set new options ?

Upvotes: 0

Views: 2010

Answers (1)

Jos de Jong
Jos de Jong

Reputation: 6809

You can use Timeline.setOptions(options) to set new options. You can get the current visible window using Timeline.getWindow() to figure out how far the user has zoomed. Just check out the docs: http://visjs.org/docs/timeline/

Upvotes: 1

Related Questions