How to save charts to .ten format with functions?

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Anton Rau
Newbie
Newbie
Posts: 11
Joined: Fri Nov 15, 2002 12:00 am
Location: Zurich, Switzerland

How to save charts to .ten format with functions?

Post by Anton Rau » Thu Feb 19, 2004 3:31 pm

Hello.

I have a chart with several series and additional function. The problem is when I am trying to save chart to .ten format there is an exception ("Cannot serialize i.e.") Is it possible to store the state of the chart when using functions like Add, Count etc.

Thank you,
Anton Rau

Anton Rau
Newbie
Newbie
Posts: 11
Joined: Fri Nov 15, 2002 12:00 am
Location: Zurich, Switzerland

Post by Anton Rau » Mon Feb 23, 2004 1:41 pm

Hello,

additional notes: you can simulate a bug just by adding to the new chart two lines series and third function series (Add, for example). Then if you click TeeChart Export - Native format then an exception will be raised:

System.Runtime.Serialization.SerializationException: The type Steema.TeeChart.Styles.Line in Assembly TeeChart, Version=1.1.1499.42325, Culture=neutral, PublicKeyToken=9c8126276c77bdb7 is not marked as serializable.
at System.Runtime.Serialization.FormatterServices.InternalGetSerializableMembers(RuntimeType type, Boolean excludeNonSerializable)
at System.Runtime.Serialization.FormatterServices.GetSerializableMembers(Type type, StreamingContext context)
at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitMemberInfo()
at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter)
at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.Serialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter)
at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Header[] headers, Boolean fCheck)
at Steema.TeeChart.Editors.Export.ExportEditor.checkBox3_CheckedChanged(Object sender, EventArgs e)
at System.Windows.Forms.CheckBox.OnCheckedChanged(EventArgs e)
at System.Windows.Forms.CheckBox.set_CheckState(CheckState value)
at System.Windows.Forms.CheckBox.OnClick(EventArgs e)
at System.Windows.Forms.CheckBox.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


Is there any bugfix or maybe some beta version is available because I need such functionality very urgent.

Best regards,
Anton Rau

Marc
Site Admin
Site Admin
Posts: 1272
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Post by Marc » Tue Feb 24, 2004 10:22 am

Hello Anton,

Yes, I can reproduce the problem, it's a bug. Thanks for letting us know. Serialization is receiving some attention for improvements in the next update.

In the meantime a workaround that will permit you to save the Chart would be to set the Function Datasource to null before exporting.

eg.

Code: Select all

f1.DataSource=null;
tChart1.Export.Template.Save(@"c:\output\ChartWithFunction.ten");
This will require that you manually set functions though, if required, in the importing Chart. The Serialization will save data if only the data reproduction of the Chart is required.

We will try to improve this and other aspects of Serialization.

Regards,
Marc Meumann
Steema Support

Post Reply