简体   繁体   English

修复彼此顶部的项目?

[英]Fix items on top of each other?

In my vis.js timeline some items get stack on top of each other so that I can't see the ones that's in the back.在我的 vis.js 时间线中,一些项目堆叠在一起,所以我看不到后面的项目。 I have tried adding margin, but that just makes the other ones (that look good) get put further away from each other.我曾尝试增加边距,但这只会使其他(看起来不错)彼此远离。

Is this a common problem and how do I fix it?这是一个常见问题,我该如何解决?

I have checked the docs, but can't find an answer.我检查了文档,但找不到答案。 http://visjs.org/docs/timeline/ http://visjs.org/docs/timeline/

vis.js 项目堆叠在一起

For anyone else having the same problem, this is what I found.对于其他有同样问题的人,这就是我发现的。

  • If the item is range type, it needs to have an end value or else it won't stack.如果项目是range类型,它需要有一个end值,否则它不会堆叠。
  • I had to apply a maxHeight to the timeline options and had to set scrollVertical to true .我必须将maxHeight应用于时间线选项,并且必须将scrollVertical设置为true

You can find more information about the configuration options here:您可以在此处找到有关配置选项的更多信息:
https://visjs.github.io/vis-timeline/docs/timeline/#Configuration_Options https://visjs.github.io/vis-timeline/docs/timeline/#Configuration_Options

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM