How do I hide the red line area

Hello Jinhua,
If you have a default layout configuration, you can hide or show the timeline by changing the gantt.config.show_chart option:
https://docs.dhtmlx.com/gantt/api__gantt_show_chart_config.html
Here is an example of how it works:
http://snippet.dhtmlx.com/600cffc72
If you have a custom layout configuration, you need to make 2 layout configurations and switch between them:
https://docs.dhtmlx.com/gantt/desktop__layout_config.html#layoutcustomization
Here is an example of how it works:
http://snippet.dhtmlx.com/5/ecdb905f9