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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Get diagram image programmatically from data

Thread ID:





132463 Sep 4,2017 06:25 AM UTC Sep 18,2017 04:03 AM UTC ASP.NET Web Forms 4
Tags: Diagram
Andrey Kucher
Asked On September 4, 2017 06:31 AM UTC

I'm using your chart as elimination diagram in my asp app (https://www.syncfusion.com/forums/129993/play-off-chart-layout-generation) and it works well, but for now I need to get image from this diagram for my reports generation. For this purpose I need to generate image in memory from diagram editor object somehow. I have found several examples but all for windows forms and I also not sure if I could use it without show diagram control in win app.

So, I need (if object node types is different in ASP and Win, then ASP way preferable)
- Create diagram object in memory (without GUI)
- Generate nodes with my logic and add to diagram
- Get chart image from diagram object with generated nodes

How could I accomplish it?

Shyam G [Syncfusion]
Replied On September 5, 2017 03:56 PM UTC

Hi Andrey, 
We can perform exporting only after the diagram is rendered. So currently it is not possible to export without rendering diagram in a browser. You can use third party tools such as phantomjs, nodejs to achieve your requirement. please refer to the below word document file in which we have explained step by step to work with phantomjs to convert diagram into SVG format. 

Please find the below link to know the step-by-step process of creating the npm package. 
Shyam G 

Andrey Kucher
Replied On September 15, 2017 05:43 AM UTC

Hello, this is good idea as far as I can see.

I'm using my server instead of node.js to reuse my code and db connections. I have added aspx page to my site and add Diagram control there, but I have trouble with call $('diagram').ejDiagram('instance') (ejDiagram: methods/properties can be accessed only after plugin creation) in phantom.js till I call ejDiagram method without params. For now I get svg but it is looks void by some cause (I see some content in txt, but page show nothing).

I think problem in my way to get diagram in js, but can't found how to resolve this.

So, please review my files and tell me why does my output is void and how could I fix it?

Attachment: docs_548dc819.7z

Andrey Kucher
Replied On September 15, 2017 07:08 AM UTC

I have found my problem. This is because I'm using wrong div name. After fixing it ot EliminationChart, I have successfully got my svg file. 

Thanks for your suggestion

Shyam G [Syncfusion]
Replied On September 18, 2017 04:03 AM UTC

Hi Andrey, 
Please let us know if you need further assistance on this. 
Shyam G 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon