DHTMLX / gantt

GPL version of Javascript Gantt Chart
https://dhtmlx.com/docs/products/dhtmlxGantt/
GNU General Public License v2.0
1.48k stars 324 forks source link

How to dynamically adjust the width of Gantt chart scroll bar #75

Closed zhao-mi closed 1 year ago

zhao-mi commented 2 years ago

How to dynamically adjust the width of Gantt chart scroll bar 甘特图滚动条宽度如何动态调整

gearcoded commented 2 years ago

@zhao-mi, there is no built-in function for that. But you can implement a custom solution by using the Gantt API and Javascript. First, Gantt has the property that reserves the scrollbar sizes in the layout: https://docs.dhtmlx.com/gantt/api__gantt_scroll_size_config.html You need to update that property and reinitialize Gantt to see the changes.

Also, the scrollbars are rendered by the browser. So, you need to add the styles to modify their appearance. To dynamically change their sizes, you can use CSS variables. Here is an example of how it can be implemented: http://snippet.dhtmlx.com/5/9ec8f8e62