Back to Devexpress

SankeyDiagramControl.LoadFromFile(String) Method

windowsforms-devexpress-dot-xtracharts-dot-sankey-dot-sankeydiagramcontrol-dot-loadfromfile-x28-system-dot-string-x29.md

latest2.5 KB
Original Source

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

csharp
public void LoadFromFile(
    string path
)
vb
Public Sub LoadFromFile(
    path As String
)

Parameters

NameTypeDescription
pathString

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.

csharp
private void Form1_Load(object sender, EventArgs e) {
    sankeyDiagramControl1.LoadFromFile("D:\\diagram1.xml");
    sankeyDiagramControl1.DataSource = GetSankeyItems();
}
vb
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
    sankeyDiagramControl1.LoadFromFile("D:\diagram1.xml")
    sankeyDiagramControl1.DataSource = GetSankeyItems()
End Sub

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

See Also

SankeyDiagramControl Class

SankeyDiagramControl Members

DevExpress.XtraCharts.Sankey Namespace