Streaming WEB teechart

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Hermes
Newbie
Newbie
Posts: 54
Joined: Tue Feb 04, 2003 5:00 am
Location: Montevideo, Uruguay

Streaming WEB teechart

Post by Hermes » Fri May 19, 2006 2:26 pm

I need to pass a web teechart in a stream from one app to another, I can't find a method to save the web teechart to a stream. Is it posible?
Could you give an example of how to save to and load from a stream a web teechart?

thank you

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 May 19, 2006 2:48 pm

Hi Hermes,

Yes, you can do something like this:

Code: Select all

  protected void Button1_Click(object sender, EventArgs e)
  {
    System.IO.MemoryStream stream = new System.IO.MemoryStream();
    WebChart1.Chart.Export.Template.Save(stream);
    Session.Add("ch1", stream);
  }
  protected void Button2_Click(object sender, EventArgs e)
  {
    WebChart1.Chart.Series.RemoveAllSeries();
  }
  protected void Button3_Click(object sender, EventArgs e)
  {
    System.IO.MemoryStream stream = new System.IO.MemoryStream();
    stream = (System.IO.MemoryStream)Session["ch1"]; 
    stream.Position = 0;
    WebChart1.Chart.Import.Template.Load(stream);
    stream.Close();
  }
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