Hello,
I want to save the YValues from a chart?
If you want to save a StringList, you can do it like this:
StringList.SaveToFile(SaveDialog1.FileName);
But this does not work when the data should be saved directly from the chart:
Chart1.SeriesList.Series[0].YValues.SaveToFile(SaveDialog1.FileName);
Then I get the message: undeclared identifier 'SaveToFile'.
What is the solution?
Thanks in advance.
Comments
: Hello,
:
: I want to save the YValues from a chart?
:
: If you want to save a StringList, you can do it like this:
: StringList.SaveToFile(SaveDialog1.FileName);
:
: But this does not work when the data should be saved directly from the chart:
: Chart1.SeriesList.Series[0].YValues.SaveToFile(SaveDialog1.FileName);
:
: Then I get the message: undeclared identifier 'SaveToFile'.
: What is the solution?
:
: Thanks in advance.
:
YOu can always copy the values into a TStringList and save that. The code for it is'nt to difficult to write. Or you can use a simple textfile and write the values directly to the disk.
: : Hello,
: :
: : I want to save the YValues from a chart?
: :
: : If you want to save a StringList, you can do it like this:
: : StringList.SaveToFile(SaveDialog1.FileName);
: :
: : But this does not work when the data should be saved directly from the chart:
: : Chart1.SeriesList.Series[0].YValues.SaveToFile(SaveDialog1.FileName);
: :
: : Then I get the message: undeclared identifier 'SaveToFile'.
: : What is the solution?
: :
: : Thanks in advance.
: :
: YOu can always copy the values into a TStringList and save that. The code for it is'nt to difficult to write. Or you can use a simple textfile and write the values directly to the disk.
:
: Actually I would like to save the data as a text file (.txt). Is it necesarry to copy it to a StringList first? And how do I do that.
Regards
: : : Hello,
: : :
: : : I want to save the YValues from a chart?
: : :
: : : If you want to save a StringList, you can do it like this:
: : : StringList.SaveToFile(SaveDialog1.FileName);
: : :
: : : But this does not work when the data should be saved directly from the chart:
: : : Chart1.SeriesList.Series[0].YValues.SaveToFile(SaveDialog1.FileName);
: : :
: : : Then I get the message: undeclared identifier 'SaveToFile'.
: : : What is the solution?
: : :
: : : Thanks in advance.
: : :
: : YOu can always copy the values into a TStringList and save that. The code for it is'nt to difficult to write. Or you can use a simple textfile and write the values directly to the disk.
: :
: : Actually I would like to save the data as a text file (.txt). Is it necesarry to copy it to a StringList first? And how do I do that.
:
: Regards
:
:
This kind of stuff is actually very basic. Here is a sample code to save the values using a simple textfile variable. It is somewhat faster than first transfering the values into a stringlist.
[code]
var
f: textfile;
i: integer;
begin
AssignFile(f, 'filename.txt');
Rewrite(f);
for i := 0 to Chart1.Series[0].YValues.Count-1 do
writeln(f, Chart1.Series[0].YValues.Value[i]);
CloseFile(f);
end;
[/code]
More info on this can be found in the help files.
Thank you very much!