Set background image for the diagram

Hi,

I am trying to find a way to set a background image on my diagram instead of the gridlines.

Is it possible?


BR,
Eden

1 Reply 1 reply marked as answer

GG Gowtham Gunashekar Syncfusion Team March 22, 2021 12:09 PM UTC

Hi Eden, 
 
We have added a sample link to demonstrate how to render an image as the diagram background. In the page settings we have a property called background, in it we can set the image and render the image as background image of diagram. 
 
Code snippet: 
<DiagramComponent 
              id="diagram" 
              ref={diagram => (diagramInstance = diagram)} 
              width={"100%"} 
              height={"580"} 
              pageSettings={{ 
                background: { 
                  source: "https://www.w3schools.com/images/w3schools_green.jpg" 
                }, 
                width: 2000, 
                height: 600, 
 
                scale: "Slice" 
              }} 
            /> 
 
 
Regards, 
Gowtham. 
 


Marked as answer
Loader.
Up arrow icon