Page 1 of 1

Charts settings are lost after copy/paste

Posted: Fri Apr 29, 2005 8:19 am
by 8127961
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.

Posted: Fri Apr 29, 2005 8:59 am
by narcis
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.