Articles in this section
Category / Section

How to render gantt fit to the browser window.

1 min read

By using “sizeSettings” API we can able to fit the Gantt to the browser window.

By default, the Gantt control size will be updated according to “sizeSettings” and “isResponsive” property values when we resize the window.

When we assign width or height value in percentage Gantt control size will be updated as per parent element size.

Please refer following code snippet,

HTML

<style>
html, body {
height: 100%;
padding: 0px;
margin: 0px;
}             
#gantt {
position: absolute;
}
</style>
<body>
<div id="gantt"></div>    
 
<script type="text/javascript">
 
$(function () {
 
$("#gantt").ejGantt({
dataSource: projectData, 
//..
sizeSettings:{
width:"100%",
height:"100%"
}
});
});
</script>
</body>

The Gantt control with 100% height/width in JS platform is available in following link.

Link: https://js.syncfusion.com/demos/web/dashboard/projecttracker/projecttracker.html

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied