Hello all,
I am new to the Infragistics Charts and Documents.I use folliowing libraries:- .Net 4.0- Infragistics NetAdvantage 2009.2
I created a DoughnutChart and can display it on my WinFormApp and I can export it to the PDF file.The Data comes from DB.
Sometimes i get only one Data-Item to display/render.Aslo DoughnutChart with only one row.By displaying it on my WinFormApp there is no problem,but if I render it to the PDF file the chart has wrong shape.Here is my exsample code:var chart = new UltraChart { ChartType = ChartType.DoughnutChart, Data = {DataSource = new [] {42}} };chart.Data.DataBind();var report = new Report();var section = report.AddSection();var band = section.AddBand();var canvas = band.AddCanvas();canvas.Width = new FixedWidth(200);canvas.Height = new FixedHeight(200);var graphics = canvas.CreateGraphics();chart.RenderPdfFriendlyGraphics(graphics, 200, 200);try{ report.Publish("out.pdf", FileFormat.PDF); new Process{StartInfo = {FileName = "out.pdf"}}.Start();}catch (Exception ex){ MessageBox.Show(ex.Message);}With this code I get following result:
I would like to have a round shape of my chart.Thanks.
Best regardsVaceslav
Hello Vaceslav,
Could you please try this approach below:
Report report = new Report(); ISection section = report.AddSection(); Infragistics.Documents.Reports.Graphics.Image image = new Infragistics.Documents.Reports.Graphics.Image(ultraChart1.Image); section.AddImage(image); report.Publish("..\\..\\Test.pdf", FileFormat.PDF); Process.Start("..\\..\\Test.pdf");
Report report = new Report();
ISection section = report.AddSection();
Infragistics.Documents.Reports.Graphics.Image image = new Infragistics.Documents.Reports.Graphics.Image(ultraChart1.Image);
section.AddImage(image);
report.Publish("..\\..\\Test.pdf", FileFormat.PDF);
Process.Start("..\\..\\Test.pdf");
and let me know if you have any questions.
Regards
Hello Georgi,Thanks for your advice.Your approach works, BUT the quality is not acceptable.
How can I adjust the Quality of Image?