Back to Devexpress

ChartControl.SaveToStream(Stream) Method

wpf-devexpress-dot-xpf-dot-charts-dot-chartcontrol-dot-savetostream-x28-system-dot-io-dot-stream-x29.md

latest2.3 KB
Original Source

ChartControl.SaveToStream(Stream) Method

Saves the chart layout to the specified stream.

Namespace : DevExpress.Xpf.Charts

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

NuGet Package : DevExpress.Wpf.Charts

Declaration

csharp
public void SaveToStream(
    Stream stream
)
vb
Public Sub SaveToStream(
    stream As Stream
)

Parameters

NameTypeDescription
streamStream

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:

csharp
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);
vb
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

SaveToFile(String)

LoadFromStream(Stream)

ChartControl Class

ChartControl Members

DevExpress.Xpf.Charts Namespace