Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

SankeyDiagramControl.SaveToStream(Stream) Method

Saves the diagram’s layout to a stream.

Namespace: DevExpress.XtraCharts.Sankey

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

NuGet Package: DevExpress.Win.Charts

#Declaration

public void SaveToStream(
    Stream stream
)

#Parameters

Name Type Description
stream Stream

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

#Remarks

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

The following code writes a 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