如何在 AnyGantt 中获得可见的开始和结束日期?

How to get visible start and end dates in AnyGantt?

如何在 AnyGantt 中获取可见的日期间隔?我需要添加两个按钮来来回移动甘特图,但我找不到如何操作。我正在考虑阅读当前的开始和结束日期,然后将甘特图缩放到新值...

谢谢。

门第,

在这种情况下,将甘特图缩放到新值是一种可用的方法。 检查此示例,该示例演示了如何使用 html 按钮和 zoomTo() 方法来滚动时间轴: https://jsfiddle.net/Shestac92/9zzhw472/3/

chart.zoomTo(start, end);

您也可以使用开箱即用的方法将类似的按钮添加到水平滚动条,查看 Anychart Playground 中的示例: https://playground.anychart.com/api/7.14.3/core/ui/anychart.core.ui.ScrollBar.buttonsVisible-plain

scrollBar.buttonsVisible(true);

希望对您有所帮助!

很高兴地通知您,新版 AnyGantt 8.1.0 提供了获取可见范围最大值和最小值的新方法。 您可以了解更多关于它们的信息,并在 the following page

上找到示例