Page 1 of 1

Export multiple charts to a pdf file (help)

Posted: Tue Jan 22, 2008 3:57 pm
by 13047900
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.

Posted: Wed Jan 23, 2008 2:43 pm
by narcis
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);