dotnetclassic Posted November 6, 2008 Report Share Posted November 6, 2008 i have 2 charts on a winform Chart1, Chart2 I populate data into Chart 1 then i perform some actions on chart1 like zooming,etc Then finally i want to copy instance of chart1 with last state into Chart2 is it poissible?????? Quote Link to comment Share on other sites More sharing options...
TomasT Posted November 6, 2008 Report Share Posted November 6, 2008 Hi, There is no clone method in Chart FX, thus there is no direct way to create a copy of the chart1 object. You may want to try exporting Chart1 to a stream using the Binary format and then import that same stream from Chart2: chart1.Export(FileFormat.Binary,myStream); chart2.Import(FileFormat.Binary,myStream); Hope this helps. TT Quote Link to comment Share on other sites More sharing options...
dotnetclassic Posted November 6, 2008 Author Report Share Posted November 6, 2008 thnx to reply i am trying with following code but error Dim myStream As New MemoryStream Chart1.Export(FileFormat.Binary, myStream) If Not IsNothing(myStream) Then Chart2.Import(FileFormat.Binary, myStream) '///////////////Error Line End If Error is Index was outside the bounds of the array Quote Link to comment Share on other sites More sharing options...
Frank Posted November 6, 2008 Report Share Posted November 6, 2008 After the Export the Stream pointer will be at the end of it. Rewind it before calling Import: myStream.Position = 0; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.