In gantt chart how can i add timeline with options like day, week, and year view


#1

In gantt chart how can i add timeline with options like day, week, and year view horizontally on top when i m following tree structure something like this


#2

Hello Nitish,
You can specify the scales in the gantt.config.scales parameter:
https://docs.dhtmlx.com/gantt/desktop__configuring_time_scale.html

gantt.config.scales = [
  { unit: "year", step: 1, date: "%Y" },
  { unit: "month", step: 1, date: "%F" },
  { unit: "week", step: 1, date: "%W" },
  { unit: "day", step: 1, date: "%d" },
];

Here is the snippet:
http://snippet.dhtmlx.com/5/73a5e97b6
If you want to switch between the scales, it would be easier to use the zoom extension:
https://docs.dhtmlx.com/gantt/desktop__zooming.html
Here is a sample:
https://docs.dhtmlx.com/gantt/samples/03_scales/05_dynamic_scales.html