【问题标题】:Is there a way to keep only the bottom part in vis.js timeline frame?有没有办法只保留 vis.js 时间轴框架的底部?
【发布时间】:2023-01-09 08:39:03
【问题描述】:

我使用 vis.js 时间线构建了以下框架:

但我只想保留底部(以蓝色突出显示)。有没有办法做到这一点?

分别代码:

export const TimelineGraph = (props) => {
  const items = props.items;
  const container = useRef(null);

  const options = {
    showCurrentTime: false
  };

  useEffect(() => {
    const timeline = container.current && new Timeline(container.current, items, options);
  }, [container, items]);

  return (
    <div
      ref={container}
      className={'container'}
    />
  );
};

【问题讨论】:

    标签: vis.js vis.js-timeline


    【解决方案1】:

    我想我找到了解决办法。您只需要将 minmax 选项添加到 options 对象,如下所示:

    const options = {
      showCurrentTime: false,
      min: getLowestDate(),
      max: getHighestDate(),
    };
    

    在那之后,上面的酒吧不见了。

    【讨论】:

      猜你喜欢
      • 2012-01-03
      • 1970-01-01
      • 2023-04-04
      • 1970-01-01
      • 2021-11-14
      • 2020-04-15
      • 2022-09-29
      • 2017-08-06
      • 2018-10-14
      相关资源
      最近更新 更多