Show number of days data in gantt timeline

I want to add one dropdown to show the number of days of data in the Gantt timeline if the user selects 2 days then shows only 2 days of data from the current date.
please help

Hello,
To set the displayed date range, you need to use the gantt.config.start_date and gantt.config.end_date parameters:
https://docs.dhtmlx.com/gantt/api__gantt_start_date_config.html

There is an example of the implementation where you can set the displayed date range from the input elements:

In your case, you can calculate the end_date parameter by adding the duration from the dropdown to the current date.
Here is an example of how it can be implemented:
https://snippet.dhtmlx.com/edqo7i1t

I am doing the same logic but in UI I am seeing black white screen means no data is printing on the screen.
why?

Hello,
Probably, the issue is related to the Gantt configuration, but it is hard to suggest what might be wrong as I don’t see your code.

Please add your configuration to the following snippet and make sure that the issue is reproduced there:

Then, click on the Save button and send me the link.
Or send me a ready demo with all the necessary JavaScript and CSS files so that I can reproduce the issue locally.