wpf-devexpress-dot-xpf-dot-charts-dot-chartcontrol-dot-savetostream-x28-system-dot-io-dot-stream-x29.md
Saves the chart layout to the specified stream.
Namespace : DevExpress.Xpf.Charts
Assembly : DevExpress.Xpf.Charts.v25.2.dll
NuGet Package : DevExpress.Wpf.Charts
public void SaveToStream(
Stream stream
)
Public Sub SaveToStream(
stream As Stream
)
| Name | Type | Description |
|---|---|---|
| stream | Stream |
The stream to which the chart layout should be written.
|
The SaveToStream method saves the chart layout (information about available series, series settings, etc.) to the specified stream. Use the ChartControl.LoadFromStream method to restore saved settings from the stream.
The following code saves the chart layout to a stream, and then loads the layout from the stream:
using System.IO;
//...
Stream stream = new MemoryStream();
// Save the chart.
stream.Seek(0, System.IO.SeekOrigin.Begin);
chartControl1.SaveToStream(stream);
// Load the chart.
stream.Seek(0, System.IO.SeekOrigin.Begin);
chartControl1.LoadFromStream(stream);
Imports System.IO
'...
Dim stream As Stream = New MemoryStream()
' Save the chart.
stream.Seek(0, SeekOrigin.Begin)
chartControl1.SaveToStream(stream)
' Load the chart.
stream.Seek(0, SeekOrigin.Begin)
chartControl1.LoadFromStream(stream)
See Also