Skip to content

LoadFromFile Method

Description

Loads a chart XML file (built using the chart builder or saved using SaveToFile).

Syntax

Public Function LoadFromFile( _
    ByVal [Path] As String _
) As Boolean

Parameters

  • Path: Path to the XML chart file to load.

Return Type

Returns True if the load is successful.

Remarks

Using the supplied "Chart Builder" tool, you can build your charts, customize the colors, etc., and export them to an XML file that can then be loaded into the chart control.

Charts created in code can also be saved to an XML file (and later re-loaded) using SaveToFile.

Chart Builder

Example

This sample shows how to load an XML chart builder file:

ChartControl.Content.Legend.Visible = True  
ChartControl.Content.Legend.HorizontalAlignment = xtpChartLegendFar  
ChartControl.Content.EnableMarkup = True  

lblTitle.Caption = "Chart From Builder File"  
ChartControl.Content.Titles.Add "Chart From Builder File"  

Dim PropExchange As PropExchange  
Set PropExchange = ChartControlGlobalSettings.CreatePropExchange  
PropExchange.CreateAsXML True, "Content"  
PropExchange.LoadFromFile (App.Path & "\ChartBuilderFile.xml")  
ChartControl.Content.DoPropExchange PropExchange

See Also


Copyright (c) 1998-2024 Codejock Technologies. All rights reserved.