almende / vis

⚠️ This project is not maintained anymore! Please go to https://github.com/visjs
7.85k stars 1.48k forks source link

How to add a gap between time nodes ? #4222

Open leon-qr-li opened 5 years ago

leon-qr-li commented 5 years ago

I'm investigating if we can use vis.js to add a gap between two time nodes. Please see screenshot as an example. I want to hide time between 17:00 pm - 9:00 am (the next day) daily, and add a grey bar before the segment. So I need to create a gap between the 17:00 and 9:00 nodes. is there a way we could do that ?

capture

javdome commented 5 years ago

Check the option hiddenDates in docs: http://visjs.org/docs/timeline/#Configuration_Options

For the grey bar, you can try the CSS style classes: Hours or Grouped hours (http://visjs.org/docs/timeline/#Styles)

leon-qr-li commented 5 years ago

Check the option hiddenDates in docs: http://visjs.org/docs/timeline/#Configuration_Options

For the grey bar, you can try the CSS style classes: Hours or Grouped hours (http://visjs.org/docs/timeline/#Styles)

Hi javdome, thanks for the reply. :)

I am using the hiddenDates to hide the time but what I actually need is that small gap between 17:00 p.m. and 9 a.m. and gap stay the same width in any zoom-in level. hiddenDates will only hide the time / date, I am kind of need a small space to represent the hidden time duration and make the bar fit in that space. (please see the screenshot above)

jgorene commented 5 years ago

@leon-qr-li Hello, as far as I know, it doesn't seem possible to do this, mainly to keep the same gap regardless of zoom level. Maybe see on this long discussion (feature request) that may seem similar to your request...