ComponentOne Chart for .NET (2.0) Search HelpCentral 

Loading and Saving to a String

In addition to loading and saving to an XML file, the chart has the ability to save to a string value. This string can then be saved in an application and retrieved at a future time.

The SaveChartToString and LoadChartFromString methods allow the saving of a copy of the chart to a string value in the application. This string value contains all the set properties, methods, and events for the chart, in essence, its formatting.  The chart can save to this file, and then if the structure remains intact, load a chart from this file.   

To save the chart to a string at run time, call the SaveChartToString method, this takes no parameters and returns the string value:

·      Visual Basic

Dim ChartString As String

ChartString = C1Chart1.SaveChartToString()

·      C#

string  ChartString;

ChartString = C1Chart1.SaveChartToString();

·      Delphi

var

  ChartString: string;

begin

  ChartString := C1Chart1.SaveChartToString();

end;

To load the chart from a string value at run time, call the LoadChartFromString method, which takes the saved chart string as its only parameter:

·      Visual Basic

C1Chart1.LoadChartFromString(ChartString)

·      C#

C1Chart1.LoadChartFromString(ChartString);

·      Delphi

begin

  C1Chart1.LoadChartFromString(ChartString);

end


Send comments about this topic to ComponentOne.
Copyright © ComponentOne LLC. All rights reserved.