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

Diagram Background Image Size

Hello, good afternoon

I'm working with ejDiagram, i'm trying to setup the backgroundImage to the diagram, what i saw is whatever image i set, is scaled to my browser window size, in this way i lose the image original size, is there any way to set backgroundImage avoiding image scaling and preserving the same image size?

Thank you

1 Reply

SG Shyam G Syncfusion Team August 17, 2015 02:07 PM UTC

Hi Luis

Thanks for using Syncfusion products.

We have created a simple sample to achieve your requirement and it is available in the below link for download. Please refer the code snippet below.

Code snippet:

$("#diagram").ejDiagram({

 

            backgroundImage: "themes/images/dashboard_img/Airline_reservation.png",
        });

$(window).load(function () {            

            var svg = document.getElementById("diagram_canvas_backgroundLayer").firstChild;

            svg.removeAttribute("preserveAspectRatio");
        });

Sample:http://www.syncfusion.com/downloads/support/forum/119929/ze/backgroundimage-1697125651

Please let us know if any concerns.

Regards,
Shyam G


Loader.
Live Chat Icon For mobile
Up arrow icon