Support sticky dates on scale cell

like the video above, could you guys support the sticky date on scale cell or layout? that we we could let user know which big scale date are they on ,for example they should know current dates is on May or June.

If dhtmlx gantt doesn’t have any official API for these, could I achieve this by some combinetions of operation?if you could achieve this, could you provide a demo to me? thanks

Hi @kevinyaoooooo !

There is no built-in option for this, but you can inject a custom DOM element into the gantt container, place it over the time scale and display a visible date there each time gantt repaints or scrolls.

Use onGanttScroll to detect when gantt is scrolled.

Use getScrollState() method to get current the scroll position:

dateFromPos() method gets the date of the specified horizontal position in the chart area.

And put the formatted date into the custom element over the time scale

Here is a sample, where you can see how it can be done:

1 Like