SankeyDiagramControl.LoadFromFile(String) Method
SECURITY-RELATED CONSIDERATIONS
Using file paths sourced from untrusted input may expose unauthorized files or allow unintended file access. Always validate and normalize all external paths to prevent path manipulation.
Restores the diagram’s layout from an XML file.
Namespace: DevExpress.XtraCharts.Sankey
Assembly: DevExpress.XtraCharts.v25.2.UI.dll
NuGet Package: DevExpress.Win.Charts
Declaration
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.