Skip to main content

ChartControl.SaveToStream(Stream) Method

Saves the chart’s layout to the specified stream.

Namespace: DevExpress.XtraCharts

Assembly: DevExpress.XtraCharts.v22.2.UI.dll

NuGet Package: DevExpress.Win.Charts


public void SaveToStream(
    Stream stream


Name Type Description
stream Stream

A Stream descendant to which the chart’s layout is written.


The SaveToStream method saves the chart’s layout (the currently selected series views and its settings, etc.) to the specified stream. The saved settings can then be restored from storage using the ChartControl.LoadFromStream method.

For more information, refer to Storing the Chart Layout.


The following example demonstrates how to save a chart to a memory stream, and then restore it.

using System.IO;
// ...

Stream stream = new MemoryStream();
// ...

// Save the chart.
stream.Seek(0, System.IO.SeekOrigin.Begin);

// Load the chart.
stream.Seek(0, System.IO.SeekOrigin.Begin);
See Also