Simple Graph ver 1.0e

Introduction
This is a set of 32 bit Delphi components and classes for 2D plot. It is relatively simple. It 
is more gauge then presentation element. The main features are:
 * Two horizontal and two vertical axis.
 * Auto minimum and maximum.
 * Panning and Zoom by mouse.
 * Buffered screen paint, can be off.
 * Copy to clipboard as DIB or as Metafile.
 * Custom Data Series.
 * DrawPlot procedure
 * On Draw events
 The main component is  Tsp_XYPlot. It holds four Tsp_Axis and controls Data Series. 
The Tsp_XYPlot and Tsp_Axis provide base plot functionality like auto scale, zoom and 
pan and so on. The Data Series must be derived from Tsp_DataSeries and implements 
data storage and how data are painted on the plot canvas. An example of these 
components is Tsp_XYLine and Tsp_SpectrLines. 
 
 License
 The component files are freeware. You may copy those files as long as you COPY ALL 
OF THEM.   Copyright  1998, Sergei P. Pod'yachev.
 
 Disclaimer
 This software and the accompanying files are provided "As Is" and without any 
warranties as to performance of merchantability or any other warranties whether 
expressed or implied. The Author cannot and does not guarantee that any 
functions contained in the Software will be error free. The author is not liable for 
any damages resulting from the use and misuse of the component.
 
 Files
 sgr_data.pas	Data series for Tsp_xyPlot derived from Tsp_DataSeries
 sgr_reg.pas	Registers components, used to install components
 sgr_reg.dcr	Components images. 
 sgr.dpk	Can be used to install components (Delphi 3 and Delphi 4)
 sgr.res   	Need to compile sgr.dpk
 Directories d2, d3 & d4 contains compiled units for Delphi 2, 3 & 4
 sgr_misc.dcu	Used by sgr_def.dcu.
 sgr_scale.dcu	Auxiliary unit, there is implementation of plot axis ancestor.
 sgr_def.dcu	Main unit. There are Tsp_xyPlot, Tsp_Axis and Tsp_DataSeries
 
 Directory help contains
 sgr_def.hlp	Components help file
 sgr_def.cnt	Help context file
 sgr_def.kwf	Key words file for Delphi 2 help system.
 
 Directory demo contains demo program.
 
 Install components
 Extract files. 
 You have to use unzip program which preserve long file name, (or you must correct 
names manually if they was cut). Place to one directory next files: sgr_reg.pas, 
sgr_reg.dcr, sgr_data.pas, sgr.dpk, sgr_misc.dcu, sgr_scale.dcu, sgr_def.dcu (Get 
dcu files which match your Delphi version from the d2 or d3 or d4 directory). 
 Delphi 2
 Run Delphi. Click Install Component menu item. Do not forget that Delphi must find 
directory where you place component files (see Search Path). Press Add button and open 
sgr_reg.pas 
 Delphi 3 and Delphi 4
 You can install components by Install Component item and sgr_reg.pas file. You also can 
use sgr.dpk. In this case, click Open menu item and select sgr.dpk, then press Compile 
and when packet will be compiled press Install. If Delphi did know components directory 
add it to Library Path on the Library Page of Environment Options.
 
 Help
 To install help file for Delphi 3
 * Copy sgr_def.hlp and sgr_def.cnt to your Delphi\HELP directory.
 * Edit the DELPHI3.CNT file and add the following line to the Index section
 * :Index Simple Graph Reference=sgr_def.hlp
 * Edit the DELPHI3.CFG file and add
 * :Link sgr_def.hlp
 * Delete the hidden DELPHI3.GID file.
  I do not check installation for Delphi 4, but I find that there are DELPHI4.CFG and 
DELPHI4.CNT files in \HELP directory are same as ones in Delphi 3. 
 
 After installation I recommend to compile demo program to check components. It also 
demonstrates how you can customize simple graph to more complex graph (title and so 
on) by using OnDrawField and OnDrawEnd events.
 Data series
 There are no many kinds of data series. But you can write it yourself, and they will match 
your needs. Inherit it from Tsp_DataSeries component and implement 1 procedure and 4 
functions:
 * procedure Draw; virtual;   //called by parent plot to draw series
 * function GetXMin(var V:double):boolean; virtual; //if it can then
 * function GetXMax(var V:double):boolean; virtual; //return True &
 * function GetYMin(var V:double):boolean; virtual; //data min or max
 * function GetYMax(var V:double):boolean; virtual;
Of course you should also implement data storage. See sgr_data.pas and sgr_def.hlp for 
more details. 
If you agree to store data in variant array there is more simple way. Derive Data Series 
from Ts_XYDataSeries.  See how Tsp_XYLine was derived from Tsp_XYDataSeries. 
In this case Draw procedure paint only lines between data points, you can override Draw 
procedure to draw data points.

Contact me
I'm glad about any kind of serious feedback! 
If there are will be new components version, in the first place they will be uploaded to 
Delphi Super Page (http://sunsite.icm.edu.pl/delphi/). I wrote several programs. They 
control chromatograph, masspectrograph, and register signals from medicine device. All 
they need component like recorder or oscillograph. I found that simple graph covered all 
my current needs. Now I have planned to improve Tsp_XYLine and modify demo 
program only. If you have any suggestions especially about the bug mentioned - send me a 
mail: Pod@iae.nsk.su.

My best wishes.

S.  P. Pod'yachev.       Novosibirsk.   Russia.
