Hi.
I create an ultrachart and then call the RenderPDFFriendlyGraphics function to render the chart to a pdf report. The code looks like this:
ICanvas canvas = newFlow.AddCanvas();
canvas.Width = new FixedWidth(210);
canvas.Height = new FixedHeight(170);
Graphics g = canvas.CreateGraphics();
ultraChart1.RenderPdfFriendlyGraphics(g);
The RenderPDFFriendlyGraphics takes a long time to execute. Is this normal? My chart consists of about 50 series each of 175 points.
Hello Sudnya,
Please answer the following questions for me so I can better assist you.
I am using NetAdvantage Windows Forms 2010.2 and visual Studio 2010.
OK I have attached a sample solution. Even in this simple program, the function takes half a minute to execute.
Thank you for the sample. I notice that your sample never actually shows the chart on the form. Have you noticed this issue occurring when you export a chart that's already been drawn on the form?
Yes you are right. I could not get the chart on the form. I slapped this sample together quickly getting the relevant parts of the code into the sample to demonstrate my point.
In the actual application this function would be called while putting the graph on the form as well as in the PDF and even then the RenderPDF function takes long.
Hi Dave.
I am including a modified sample which shows how the charts and Render function is used in the application. The chart is drawn on a reportPreviewCtrl. I have modified the sample to reflect this.
I wasn't able to get your modified sample to run, so I created my own sample that exports a chart to a PDF using the RenderPDFFriendlyGraphics() method. I'd like you to check the sample out to see if it reproduces the issue. If it doesn't, then compare it with your sample to see what I might be doing differently.
Sorry for the delay but I found the cause of the issue and it is currently being verified and if all goes well a fix will be available in the next Service Release. Let me know if you see anything else performance related to the chart -> pdf process but I think you'll be pleasantly surprised by the speed of the process now.
I've submitted this issue to our engineers for them to research. I've created a private support case so you can be notified of the results of their research.
Thats what we currently do in the application. However, when the bitmap is plotted on a PDF and the document is zoomed the bitmap loses its resolution and looks grainy. This was the reason I was exploring other options and came across the RenderPDFFriendlyGraphics function.
So using the bitmap is not really an option.
It might be more feasible for you to call DrawToBitmap() and then insert that bitmap into the document.
OK. I am working with medical software and this will be the minimum amount of data I am plotting per graph. Plus I am plotting 6 such graphs.
So that probably means using the infragistics chart in this situation is not going to deliver the results in a resonable amount of time. Do you have any other suggestions as to what I can use.
Thanks.
Sudnya