Charts settings are lost after copy/paste

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Sander
Newbie
Newbie
Posts: 5
Joined: Wed Nov 24, 2004 5:00 am
Contact:

Charts settings are lost after copy/paste

Post by Sander » Fri Apr 29, 2005 8:19 am

In a tabbed form, i want to copy the chart of TabX into the chart of TabY, after this the ORIGINAL chart settings are lost.

Ok i can understand that the settings can not be copied using this method, but the fact that the original graph is altered concerns me.

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

Post by Narcís » Fri Apr 29, 2005 8:59 am

Hi Sander,

To copy one chart to another the best option is importing the source chart to a stream and import the stream to the destination chart doing:

Code: Select all

			System.IO.MemoryStream m = new System.IO.MemoryStream();
			tChart1.Export.Template.Save(m);
			m.Position=0;
			tChart2.Import.Template.Load(m);

			commander1.Chart=tChart2;
In case you were using a Commander you should have to reasociate it with the chart as in the code above.
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