Roadmap Tutorial API's: XYGraph Axes etc Series Stats
You can save the graph to a file and reload it later. The graph format has been designed to be forwards compatible. The first element in the image is a version identifier. This is not the version of TxyGraph but the version of the file format. When the format is no longer backwards compatible with this current release the file format version will be incremented.
You can also write an exactly identical image to a stream rather than a file to store it with other things or in database. Some of the procedures used to save the graph to a file are also used in the form streaming so that data in the graph at design time will be present at run-time
You have a choice of writing a format that includes text representations of the data or native stream representations.This is set by wantcompactfile in xyData.pas. The native stream representation is more compact but you may find the string representation more useful for debugging. The string format still includes some data in binary representation, including the TWriter/TReader separators. Any TxyGraph v3+ will be able to read either.
When you save to a graph you can choose whether to include data or not. Not saving the data is equivalent to saving a template.
The following properties are not saved along with the graph in the file:
The format consists of a header, then 6 sections - in order:
followed by 2 Blocks:
and then a number of sections dictated by the counts above:
Each block consists of :
each Section is a series of blocks
Series Sections are more complicated: they have a TSeries Section, then a TDataSeries section, followed by the data for the series. The data begins with 3 pieces of information: the number of points, the number of values per point (allow future expansion) and the format of the points - string or float (=binary)