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.LoadFromFile(String) Method

Restores the diagram’s layout from an XML file.

Namespace: DevExpress.XtraCharts.Sankey

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

NuGet Package: DevExpress.Win.Charts

#Declaration

public void LoadFromFile(
    string path
)

#Parameters

Name Type Description
path String

Specifies the path to the file that contains the layout.

#Remarks

Use the LoadFromFile method to load a diagram’s layout from an XML file. If this file does not exist, a System.IO.FileNotFoundException exception is raised. The resulting file does not contain information about a diagram source’s data - you should to specify the control’s DataSource property after the LoadFromFile method is called.

private void Form1_Load(object sender, EventArgs e) {
    sankeyDiagramControl1.LoadFromFile("D:\\diagram1.xml");
    sankeyDiagramControl1.DataSource = GetSankeyItems();
}

To save a layout a file, call the ChartControl.SaveToFile method.

See Also