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
close icon

FitToPage

I want to make the diagram fit to page. I've used the following javascript code:
var diagram = $("#dgrMap").ejDiagram("instance");
 diagram.fitToPage("width", "pageSettings", { "left": 15, "top": 15, "right": 0, "bottom": 15 });
but it does not work and I get the following javascript error: Cannot get x property of a null or undefined reference.
With the previuos version of essential studio I used
diagram.fitToPage("width", "page", { "left": 15, "top": 15, "right": 0, "bottom": 15 });
and it worked.
Thanks.


7 Replies

SG Shyam G Syncfusion Team October 5, 2015 06:06 AM UTC

Hi Cosimo,

We have checked fitToPage method with your code snippet in our sample and we are unable to reproduce the reported issue at our end. please provide us more details such as sample or aspx,aspx.cs file that you have used in your application or modify the below sample to reproduce the reported issue. Please refer the below sample and video for your reference.

Sample:http://www.syncfusion.com/downloads/support/forum/120673/ze/FittoPagesample1417434320

Video:http://www.syncfusion.com/downloads/support/forum/120673/ze/Fittopagevideo2097261970

Regards,

Shyam G



CC Cosimo Carbonelli October 6, 2015 10:30 AM UTC

Hi Shyam,
I copied the file ej.web.all.min.js from your sample and no it works.
Thanks.



SG Shyam G Syncfusion Team October 7, 2015 09:16 AM UTC

Hi Cosimo,

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

Regards,

Shyam G



CC Cosimo Carbonelli October 7, 2015 09:48 AM UTC

Hi Shyam,
Before using the javascript ej.web.all.min.js that you used in the sample you sent me, I used the one included in the latest version of essential studio (13.3.0.7). The version 13.3.0.7 solved the problem related to the settings of the size of th treegrid using javascript code (see incident) but has a problem with the fittopage method of diagram. If I use the javascript of the sample it solves the fittopage problem but I have problems settings the size of th treegrid using javascript code. So now I have to use two different versions of the javscript, one in the page of the diagram and one in the page of the treegrid. How can I solve this problem. I attach the two script, ej.web.all.min.js is the one of the sample, ej.web.all2.min.js is the one of the version 13.3.0.7.
Thank you.

Attachment: ej.web.all.min_fd47b13e.zip


SG Shyam G Syncfusion Team October 8, 2015 09:45 AM UTC

Hi Cosimo,

We have checked both your “ej.web.all.min.js” file and tested in various use cases such as setting node in negative axis, diagram with swim lane. We are unable to reproduce the reported issue and suspect that you have added additional code in your sample. 

So, please provide that additional code that you have added in your sample or script file (FitToPage method defined script file) or modify the below sample to reproduce the reported issue. Please refer to the below sample and video. 

Sample:http://www.syncfusion.com/downloads/support/forum/120673/ze/FittoPagesample_latest921063045

Video:http://www.syncfusion.com/downloads/support/forum/120673/ze/fittopagevideolatest747545412

Regards,

Shyam G



CC Cosimo Carbonelli October 12, 2015 08:32 AM UTC

Hi Shyam,
I attach all the javscripts that I use. Ta javascript of the page is treegraph.js. Thank you.
Best regards.

Attachment: AttachSyncfusion_1bed437b.zip


SG Shyam G Syncfusion Team October 13, 2015 12:50 PM UTC

Hi Cosimo,

We have checked your Script file in our sample and we are unable to reproduce the reported issue at our end. please provide us more details such as video or aspx,aspx.cs file or diagram initialization,pageSettings that you have defined in your application or modify the below sample to reproduce the reported issue.

Sample:http://www.syncfusion.com/downloads/support/forum/120673/ze/fittopagelatestsample1033456903

Regards,
Shyam G

Loader.
Live Chat Icon For mobile
Up arrow icon