We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Set diagram height to 100% of browser window

Hi, I would like to create diagram canvas that will fill browser window completely. I have problem to set it to 100% height - is it possible to achieve this?

3 Replies

SG Shyam G Syncfusion Team October 4, 2016 10:31 AM UTC

Hi Tom, 
We can set the diagram models height in percentage. Also if you set the model’s height in percentage, then the diagram’s height will be set based on the parent elements height.  We have created a sample in which we have set the parent’s element(body,html) height in percentage using CSS. Please refer to the code example and sample below. 
Code example: 
DiagramProperties model = new DiagramProperties(); 
 model.Height = "100%"; 
 model.Width = "100%"; 
    html, body { 
Shyam G 

TF Tom Frajer October 4, 2016 11:32 AM UTC

Great, now it works. I needed to set my html and body to 100% too.

SG Shyam G Syncfusion Team October 5, 2016 04:00 AM UTC

Hi Tom, 

Please let us know if you need further assistance on this. 

Shyam G 

Live Chat Icon For mobile
Up arrow icon