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,
I've done some more testing and it appears the delay is happening because of the amount of data being plotted. You can verify this yourself by commenting out the second loop in the CreateCharts() method in your sample. You'll see that the amount of time taken is just about halved.
Thanks Dave. I really appreciate your help.
I was able to reproduce the issue in my sample by copying some parts of your code into my sample. After doing so I discovered that the PrintPreviewControl has nothing to do with this issue, since the call to RenderPdfFriendlyGraphics() is before any reference to the PrintPreviewControl.
I believe the issue may have something to do with how you're setting up the data since if I set the chart to be visible, I get an error about there being no data. I will do some more research and update this thread again tomorrow.
Hi Dave.
I looked at your sample. I think you are asking me to compare apples and oranges. You are creating a scatter chart and I am creating a spline chart. Also another reason your sample cannot be compared to is because we are using a reportPreviewCtrl on which we draw. I wonder if thats different than drawing on a form directly.
Also I downloaded my modified sample. It is runnable. When you run the program you have to wait half a minute to see anything on the screen because thats how long it takes for the Render function to run!!! You just have to give it time to run. If not put a break point on the Render funtion so that you dont feel like the program isnt running.
If you create a sample which draws 70+ splines on a chartr and drops that on a reportPreviewCtrl , I think that would help me immensely to determine what I am doing wrong.
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.