Sometimes it's very useful to be able to save the state of the component to a file or memory stream. For example if you want to implement custom Undo and allow your user to revert to some previous state or if you want to create template galleries with frequently used charts so that you do not have to write the code to configure them again.
Nevron Chart for .NET supports various ways to serialize the state. Furthermore the state files generated by the Windows Forms and Web Forms are compatible meaning that you can use state files generated by the Windows Forms chart control in Web Forms chart control and vice versa. In order to import or export the chart state in binary format you must gain access to the NControlSerializer object exposed by the Serializer property exposed of the WinForms and WebForms control.
C# |
Copy Code
|
---|---|
NControlSerializer serializer = chartControl.Serializer; |
Visual Basic |
Copy Code
|
---|---|
Dim serializer As NControlSerializer = chartControl.Serializer |
The following topics will teach you how to work with the Serializer to save individual chart objects as well as the whole control state.