Export multiple charts to a pdf file (help)

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Jeff
Newbie
Newbie
Posts: 2
Joined: Mon Jan 07, 2008 12:00 am

Export multiple charts to a pdf file (help)

Post by Jeff » Tue Jan 22, 2008 3:57 pm

Hi,


Actually, i am trying to export multiple charts to one pdf file but i am not able to do that.

i can export one char to a file using this way(Steema.TeeChart.Export.PDFFormat.SaveToFile(TChart2.Chart, "c:\test.pdf")) but still i am getting the wrong format(its coming up with funny looks)


if we can't add multiple charts into a pdf file so can we add multiple charts into jpeg or any other image format?


please help me out to solve my problem.

Thanks in advance.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Jan 23, 2008 2:43 pm

Hi DaveR,
Actually, i am trying to export multiple charts to one pdf file but i am not able to do that.
I'm afraid this is not possible for now. I' ve added your request to our wish-list to be considered for inclusion in future releases.
i can export one char to a file using this way(Steema.TeeChart.Export.PDFFormat.SaveToFile(TChart2.Chart, "c:\test.pdf")) but still i am getting the wrong format(its coming up with funny looks)
Could you please let us know the exact TeeChart version you are using and send us an image of that chart and corresponding pdf document? You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
if we can't add multiple charts into a pdf file so can we add multiple charts into jpeg or any other image format?
Yes, this is possible doing something like this:

Code: Select all

			TChart tChart1 = new TChart();
			TChart tChart2 = new TChart();

			tChart1.Width = 300;
			tChart1.Height = 200;

			tChart2.Width = 300;
			tChart2.Height = 200;

			Steema.TeeChart.Styles.Line line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
			line1.FillSampleValues();

			Steema.TeeChart.Styles.Line line2 = new Steema.TeeChart.Styles.Line(tChart2.Chart);
			line2.FillSampleValues();

			MemoryStream stream1 = new MemoryStream();
			tChart1.Export.Image.JPEG.Save(stream1);
			Image img1 = System.Drawing.Image.FromStream(stream1);
			
			MemoryStream stream2 = new MemoryStream();
			tChart2.Export.Image.JPEG.Save(stream2);
			Image img2 = System.Drawing.Image.FromStream(stream2);

			Bitmap img3 = new Bitmap(img1.Width, img1.Height + img2.Height);

			Graphics gfx = Graphics.FromImage(img3);

			gfx.DrawImage(img1, new Point(0, 0));
			gfx.DrawImage(img2, new Point(0, img1.Height));

			img3.Save("FinalChart.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply