Exporting a chart refers to saving it in some other file format to enable the end-user to store it for later use. For instance, a chart saved as an image can be used in a presentation or any other application.
FlexChart provides the SaveImage method of FlexChartBase class that lets you save a chart as an image to the specified stream. This method takes four parameters, the stream, the image format, width and height of the image. The formats currently supported by the FlexChart control are .png, .jpeg, and .svg.
Also, the FlexChartBase class also provides the SaveImage (int w, int h) method to save the chart as image to the clipboard, with the method taking two parameters, the image width and height.
Serialization refers to the conversion of chart object in to a sequence of bytes or a file, that can be stored and transmitted. This concept is generally used when data related to objects have to be transferred from one application to another to replicate the same in another application for further use.
In FlexChart, you can serialize chart into various file formats using the C1.Win.Chart.Serialization assembly. You can obtain this assembly by building the product sample named C1.Win.Chart.Serialization and accessing obj\Debug folder inside the project. This assembly provides the Serializer class which provides methods to serialize a chart to the xml, json, binary and base64 formats. In this example, we are using SerializeChartToFile method that lets you serialize a chart to any of these formats. This method accepts three parameters, file name to which FlexChart object properties are to be stored, the FlexChart instance to be serialized and the file format to which FlexChart instance is to be saved. Similarly, you can use other methods such as SerializeChartToXml for serializing chart to a specific format such as XML in this case.
Note: C1.Win.Chart.Serialization sample is located at \Documents\ComponentOne Samples\WinForms\v4.5.2\C1FlexChart\CS\FlexChartSerializer on your system, if you have installed the samples while installing WinForms Edition using ComponentOneC1ControlPanel.exe.
De-serialization refers to the process of reading the state of object stored in a byte stream to import the original object. In FlexChart, just like serialization, you can de-serialize these settings saved in a particular file format to re-construct the chart by using various de-serialization methods exposed by the Serializer class of C1.Win.Chart.Serialization assembly. In this example, we are using DeserializeChartFromFile method which accepts three parameters and can re-create a chart from any file format. The three parameters are name of the file that contains the FlexChart object properties, FlexChart instance to be recovered and format of the file from which FlexChart instance has to be recovered.