Skip to main content
A newer version of this page is available. .
All docs
V20.2

SankeyDiagramControl.SaveToStream(Stream) Method

Saves the diagram’s layout to a stream.

Namespace: DevExpress.Xpf.Charts.Sankey

Assembly: DevExpress.Xpf.Charts.v20.2.dll

NuGet Packages: DevExpress.WindowsDesktop.Wpf.Charts, DevExpress.Wpf.Charts

Declaration

public void SaveToStream(
    Stream stream
)

Parameters

Name Type Description
stream Stream

A Stream descendant to which the diagram’s layout is saved.

Remarks

Use the SaveToStream method to save the diagram layout to a stream. If the specified stream is empty or null (Nothing in Visual Basic), an exception is raised. To load the diagram layout from a stream, use the LoadFromStream method.

The following code saves the diagram’s layout to a stream, and then loads the layout from the stream:

using System.IO;
//...

  Stream stream = new MemoryStream();

  // Save the diagram.
  stream.Seek(0, System.IO.SeekOrigin.Begin);
  sankeyDiagramControl1.SaveToStream(stream);

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