Skip to main content

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

ChartControl.SaveToStream(Stream) Method

Saves the chart layout to the specified stream.

Namespace: DevExpress.Xpf.Charts

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

NuGet Package: DevExpress.Wpf.Charts

#Declaration

public void SaveToStream(
    Stream stream
)

#Parameters

Name Type Description
stream Stream

The stream to which the chart layout should be written.

#Remarks

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.

#Example

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);
See Also