Copyright: (c) 1998 H. Lohninger, Vienna, Austria


Public Types

DateForTimeType

DateOrderType

FigType

FrameStyleType

GridStyleType

InscriptStr

ItemType

LabelFormatType

LabelStr

MouseActMode

PDrawCan

TBakGndImg

TBkgFill

TCrossHMode

TDrawCan

TDTLabel

TimeFormatType

TMouseMoveInChartEvent

TRFrameStyle

TRChMouseLabel

TTextBkg

YearLengthType

ZoomStateType


Events_8
Events

OnClick

OnDblClick

OnMouseMove

OnMouseDown

OnMouseUp

OnMouseMoveInChart

OnZoomPan


Methods

AutoRange	Bar3D

ClearGraf	ConfineZoomRange

CopyToBMP	CopyToClipboard

CopyToOpenPrinter	CopyToOpenPrinterHiRes

CrossHairSetPos	CrossHairSetup

DrawTo	Ellipse

FindMinMax	FindNearestItemReal

FindNearestItemScreen	GetItemParams

Line	LoadLinkedList

M2R	MarkAllItems

MarkAt	MarkItemsInWindow

MoveTo	MouseBox

NewColorOfClassItems	PrintIt

PrintItHiRes	R2M

Rectangle	RectFrame

RemoveFirstItem	RemoveItem

RemoveLastItem	SaveLinkedList

SaveLinkedListASC	ScaleAllItems

ScaleItem	ScaleSelectedItems

SetItemParams	SetRange

ShowGraf	ShowGrafNewOnly

ShowNumLabel	Text

ZoomHistory


Properties_1
Properties

Align	AutoRedraw	BackGroundImg

BRim	Caption	ChartColor

ClassDefault	ClassVisible	CrossHairPosX

CrossHairPosY	Cursor	DataColor

DataTag

DecPlaceX	DecPlaceY	DTXFormat

DTYFormat	FillColor	FirstItemOfLinkedList

Font	GridColor	GridDx

GridDy	GridStyle	Height

Hint	IdAbscissa	IdOrdinate

Left	LineWidth	LogScaleX

LogScaleY	LRim	MinTickX

MinTickY	MouseAction	MouseCursorFixed

MousePosX	MousePosY	MXLabFormat

MYLabFormat	MXTrackOn	MYTrackOn

PopupMenu	RangeHiX	RangeHiY

RangeLoX	RangeLoY	RRim

ScaleColor	ScaleInscriptX	ScaleInscriptY

ShadowColor	ShadowBakColor	ShadowStyle

ShadowWidth	ShortTicksX	ShortTicksY

ShowHint	Tag	TextAlignment

TextBkColor	TextBkStyle	TextFontStyle

Top	TRim	TypeOfFirstItem

TypeOfLastItem	UserTickTextX	UserTickTextY

Visible	Width

WindColor	XLabelType	YLabelType

ZoomState


Align (TRChart)
 Align

See also:	Delphi manual

Class:	TRChart

Declaration:	property Align: TAlign;

The Align property determines how the chart aligns within its container (or parent control). The property Align may take the following values:

alNone	The component remains where you place it in the form.

alTop	The component moves to the top of the form and resizes to fill the width of the form. The height of the component is not affected.

alBottom	The component moves to the bottom of the form and resizes to fill the width of the form. The height of the component is not affected.

alLeft	The component moves to the left side of the form and resizes to fill the height of the form. The width of the component is not affected.

alRight	The component moves to the right side of the form and resizes to fill the height of the form. The width of the component is not affected.

alClient	The component resizes to fill the client area of a form. If a component already occupies part of the client area, the component resizes to fit within the remaining client area.


 BackGroundImg

See also:	TBkgFill

Class:	TRChart

Declaration:	property BackGroundImg: TBakGndImg;

The property BackGroundImg specifies the chart background image and its associated options. The background image is displayed as the chart window background. This image has to be an uncompressed (Windows) BMP file of any color depth and size. The background image is loaded at run-time from the disk. If Rchart does not find a background image at the specified location, no background image at all is displayed.

Please note, that while a background image may significantly enhance the appeal of a chart, it also slows down the display process. Thus it is not recommended to use background images for animated charts.

The following subproperties define the properties of the background image and are available within the object inspector. Please note that these properties can be edited also by using the property editor which comes up when clicking at the ellipses of the BackGroundImg property.

property Name: string;

property IncludePath: boolean;

property FillMode: TBkgFill;

Name	The Name property contains the name of the background file. Note that the name property can be stripped off the path information by setting the property IncludePath to FALSE. If a file name is manually entered which does not exist, the Name property is automatically cleared.

IncludePath	Under most circumstances it is advantageous to use only the file name of the background image without any path information. Set  the property IncludePath to TRUE if you want to include the path of background file.

FillMode	The property FillMode defines the mode of the background fill. Three different fill modes are available: bfSimple, bfStretch, bfTile. See the TBkgFill description for details.


Bar3D method
 Bar3D

See also:	Rectangle, RectFrame

Class:	TRChart

Declaration:	procedure Bar3D (llx, lly, urx, ury: double; Depth: integer; Angle: integer);

The method Bar3D displays 3D bars of any size. The user has to specify the dimensions of the front rectangle (parameters llx, lly, urx, and ury) in real-world coordinates. The depth has to be specified in pixel coordinates (0..100), the angle is specified in degrees (0..180). The line width of the 3D bar frame may be adjusted by the property LineWidth. The colors of the 3D bar are determined by the properties DataColor (= frame of bar) and FillColor (= body of bar).

Example:	RCH3DBAR.DPR

This example program shows a sample 3D bar diagram. The height of the bars, their common depth, and their common angle can be changed by unsing scrollbars.


BRim property
BRim

See also:	LRim, RRim, TRim, Height, Width

Class:	TRChart

Declaration:	property BRim: integer;

The property BRim specifies the distance between the bottom boundary of the chart window and the chart drawing area. The distance BRim is specified as the number of pixels between the two boundaries.


Caption (TRChart)
 Caption

See also:	IdAbscissa, IdOrdinate

Class:	TRChart

Declaration:	property Caption: string;

The property Caption specifies the header of the chart which is displayed at the upper right part of the chart. Note, that the property TRim has to be set properly in order to leave enough room for the caption. In addition, the Caption property may collide with the IdOrdinate of the chart.


ChartColor property
 ChartColor

See also:	DataColor, ScaleColor, WindColor

Class:	TRChart

Declaration:	property ChartColor: TColor;

The property ChartColor controls the color of the chart area (the area where the data objects are drawn). Note, that the color of the chart area can be different from the background color of the TRChart window.


 Class numbers

See also:	ClassDefault, ClassVisible

Class:	TRChart

When handling scientific or technical graphs it is often necessary to treat some of the graphics elements differently from others. This can be easily achieved within TRChart by assigning a class number to each graphics element which belongs to a certain group. The class number is set to the ClassDefault value when an item is entered into the linked list. Selected classes may be "switched on and off" by the array property ClassVisible.

The class numbers can take values between 0 and 254. A value of 255 is reserved as a place holder for all classes. The class numbers can be manipulated by some methods, like SetItemParams, MarkItemsInWindow, and MarkAllItems.


 ClassDefault

See also:	class numbers, ClassVisible

Class:	TRChart

Declaration:	property ClassDefault: byte;

The property ClassDefault sets the default class number which is assigned to a newly drawn graphics item. ClassDefault can be set to any value between 0 and 254. The value of 255 is reserved as a place holder for all classes.


ClearGraf method
 ClearGraf

See also:	ShowGraf

Class:	TRChart

Declaration:	procedure ClearGraf;

The method ClearGraf empties the linked list of the graphics memory, clears the drawing area and initializes its attributes. This method should be called whenever a new chart has to be generated.


CopyToBMP (TRChart)
 CopyToBMP

See also:	CopyToClipboard

Class:	TRChart

Declaration:	procedure CopyToBMP (FName: string);

The method CopyToBMP creates a Windows BMP file using the file specification FName. The bitmap file contains the whole chart display, including axes and inscriptions. The bitmap is stored as 24 bit color map, the file extension is automatically set to ‘.BMP’ regardless of the extension in the parameter FName.


CopyToClipboard (TRChart)
 CopyToClipboard

See also:	CopyToBMP

Class:	TRChart

Declaration:	procedure CopyToClipboard;

The method CopyToClipboard copies the bitmap of RChart into the Windows clipboard.


 CopyToOpenPrinter

See also:	CopyToOpenPrinterHiRes, PrintIt

Class:	TRChart

Declaration:	procedure CopyToOpenPrinter (var x,y: integer; ScaleF: double; BlkWhite: boolean);

The method CopyToOpenPrinter is a more flexible alternative to the method PrintIt. It provides a way to create a graphical output on the currently selected printer. You may change the selected printer by assigning a proper value to the PrinterIndex property of the Printer object before calling CopyToOpenPrinter. In contrast to PrintIt, the user has to take care by himself that the printer object is already open for receiving data. This can be accomplished either by the method Printer.BeginDoc (see Delphi manual for details), or by assigning the printer output to a text file (Delphi procedure AssignPrn).

The variable parameters x and y contain the coordinates of the upper left corner of the chart in printer coordinates on entry of the routine, and return the printer coordinates of the lower right corner of the chart after the method is finished. This feature can be used to combine several hardcopies on one page, since the x- and y-values after a first hardcopy can be partly used as inputs of the next hardcopy.

The parameter ScaleF determines the magnification factor of the printout. A factor of 1.0 creates an output which has roughly the size of the screen image (assuming a monitor resolution of 80 dots per inch). If the parameter BlkWhite is set to TRUE, the colors of the chart are suppressed and the chart is printed in black and white. This is normally the best way to proceed with B&W printers.

Example 1:	The following code snippet shows a short example how to mix several graphics and some text on one printer page.

  Printer.BeginDoc;

  Printer.Canvas.TextOut (300,180,'This is some text');

  Printer.Canvas.TextOut (300,240,'Another text line');

  x := 100;

  y := 270;

  RChart1.CopyToOpenPrinter (x,y, 0.8, true);   { the first chart }

  Printer.Canvas.TextOut (300,y+20,'Yet another line of text');

  x := 10;

  y := y+80;

  RChart1.CopyToOpenPrinter (x,y, 0.4, true);  { the second chart }

  Printer.EndDoc;


Cursor (TRChart)
 Cursor

See also:	MouseCursorFixed, CrossHairSetup

Class:	TRChart

Declaration:	property Cursor: TCursor;

The property Cursor property determines the image used when the mouse passes the chart area. See also the Delphi manual for the cursor property.


DataColor property
 DataColor

See also:	ChartColor, ScaleColor, FillColor, WindColor

Class:	TRChart

Declaration:	property DataColor: TColor;

The property DataColor specifies the color of the data items drawn next. The color is stored internally along with the graphics objects so that each graphics object can have a different color. See the Delphi documentation for details on the TColor type.

Hint:	Try to avoid situations where the colors of the data items are permanently changed during the drawing process. This will slow down graphics by up to 20 %. Instead, data items of the same color should be drawn, and then the items of the next colors and so on.


Date and Time on Axes
 Date and Time Inscription of the Axes

See also:	DTXFormat, DTYFormat

TRChart provides an efficient way to create axes which are labelled by date and time. The range of the axis should therefore be set to the appropriate TDateTime (see Delphi reference) values. The property XLabelType (or YLabelType, respectively) has to be set to ftDateTime. In order to set up the range of an axis the properties RangeLoX and RangeHiX (or, RangeLoY and RangeHiY) can be set most conveniently by using the functions StringToDateTime, or EncodeDate and EncodeTime. Of course, the user may also assign any TDateTime variable or any function which returns a TDateTime value (such as the function Now) to the RangeXXX properties.

The format of a date/time axis can be adjusted in several respects by changing the property DTXFormat (or DTYFormat).

Note that date/time axes are restricted by the following limitations:

* Date/time axes must not be logarithmic (the property LogScaleX (or LogScaleY) is automatically set to false, if XLabelType (or YLabelType) is set to DateTime).

* No part of the axis must be negative.

* The axis must not be decreasing (with decreasing values from left to right, or from bottom to top).

* The axis may not span a range below 1 second.

* The first date which can be handled is  Jan-1, 0001 (no B.C. !).

* The last date is Dec-31, 9999.

Note:	Delphi 1.0 calculates the date from year 1 whereas Delphi 2.0 calculates it from 1899. To convert a Delphi 1.0 date to a Delphi 2.0 date, subtract 693594.0 from the Delphi 1.0 date.

The following example shows how to set up the range of the x-axis by using the EncodeTime and EncodeDate functions. The DTXFormat property is used with the default settings:

RChart1.XLabelType := DateTime;

RChart1.RangeLoX := EncodeDate (1968,2,23) + EncodeTime (0,0,0,0);

RChart1.RangeHiX := EncodeDate (1968,2,25) + EncodeTime (18,00,0,0);

The result may look like this (depending on the DTXFormat settings):


DateForTimeType type
 DateForTimeType

See also:	TimeFormatType, DTXFormat, DTYFormat

Class:	TRChart

Declaration:	DateForTimeType = (dtNone, dtOnePerChart, dtOnePerDay, dtAllTicks);

The type declaration DateForTimeType defines how frequently the time labels are accompanied by a date label in case of a DateTime axis inscription.

dtNone	No date labels are displayed

dtOnePerChart	A date label is displayed only together with the first time label.

dtOnePerDay	Each day is labelled by an extra date label. This is especially useful if an axis spans a time range of a few hours around midnight.

dtAllTicks	Each scale tick is labelled both with time and date labels


DateOrderType type
 DateOrderType

See also:	TimeFormatType, DTXFormat, DTYFormat

Class:	TRChart

Declaration:	DateOrderType = (doMMDDYY, doDDMMYY, doYYMMDD);

The type declaration DateOrderType defines the order of the date when displayed as an axis inscription.


DecPlaceX property
 DecPlaceX

See also:	DecPlaceY

Class:	TRChart

Declaration:	property DecPlaceX: integer;

The property DecPlaceX determines the number of decimal places used for the scale on the abscissa. DecPlaceX may take values between -3 and +6. The negative values have the following special meaning:

-1:	The labels on the scale are displayed using exponential notation.

-2:	The number of decimal places is automatically adjusted according to the range of the axis. This mode is recommended for applications where the user is allowed to change the extents of a chart.

-3:	Only the exponent of the labels are displayed. This special value is valid only for logarithmic axes; in case of a linear axis it is treated as -2.

Note, that the actual length of a single numeric label is restricted to 8 characters (decreasing the number of decimal places if necessary).

Hint:	In case of a logarithmic x-axis DecPlaceX should be set to -1, or -2 (recommended), or -3.


DecPlaceY property
 DecPlaceY

See also:	DecPlaceX

Class:	TRChart

Declaration:	property DecPlaceY: integer;

The property DecPlaceY determines the number of decimal places used for the scale on the ordinate. DecPlaceY may take values between -3 and +6. The negative values have the following special meaning:

-1:	The labels on the scale are displayed using exponential notation.

-2:	The number of decimal places is automatically adjusted according to the range of the axis. This mode is recommended for applications where the user is allowed to change the extents of a chart.

-3:	Only the exponent of the labels are displayed. This special value is valid only for logarithmic axes; in case of a linear axis it is treated as -2.

Note, that the actual length of a single numeric label is restricted to 8 characters (decreasing the number of decimal places if necessary).

Hint:	In case of a logarithmic y-axis DecPlaceY should be set to -1, or -2 (recommended), or -3.


DrawTo (TRChart)
 Drawto

See also:	Line, MoveTo, LineWidth

Class:	TRChart

Declaration:	procedure DrawTo (x,y: RType);

The method DrawTo draws a line from the current cursor position to the point (x,y). The coordinates are real coordinates of the chart window. Note that the cursor position is updated to the position (x,y). The line width may be adjusted by the property LineWidth.


DTXFormat property
 DTXFormat

See also:	DTYFormat, Date and Time Axis Inscription

Class:	TRChart

Declaration:	property DTXFormat: TDTLabel;

The property DTXFormat defines the format of the date/time labelled x-axis and contains the following sub-properties:

property TimeFormat: TimeFormatType;

property DateSeparator: char;

property TimeSeparator: char;

property YearLength: YearLengthType;

property MonthName: boolean;

property DateOrder: DateOrderType;

property DateForTime: DateForTimeType;

TimeFormat	The TimeFormat property determines the format of the time. TimeFormat may take the following values: tfHHMMSS, tfHHhMM, tfAMPM.

DateSeparator	The date separator may be any printable character.

TimeSeparator	The time separator may be any printable character.

YearLength	The YearLength property determines how many digits are used for the display of the year (2, 4, or none at all). YearLength may take the following value: ylNone, ylYY, ylYYYY.

MonthName	The month is displayed by its 3-character abbreviation, if MonthName is set to TRUE. Otherwise the number of the month is used.

DateOrder	The DateOrder property determines the order of the date items in the date labels. The following values are available: doMMDDYY, doDDMMYY, doYYMMDD.

DateForTime	The DateForTime property defines the way how the date labels are placed, if an axis is displayed which is in the range below a few days. DateForTime may take one of the following values: dtNone, dtOnePerChart, dtOnePerDay, dtAllTicks.


DTYFormat property
 DTYFormat

See also:	DTXFormat, Date and Time Axis Inscription

Class:	TRChart

Declaration:	property DTYFormat: TDTLabel;

For a detailed description, see DTXFormat.


Ellipse method
 Ellipse

See also:	Rectangle

Class:	TRChart

Declaration:	procedure Ellipse (cx, cy, HorizAxLeng, VertAxLeng: double);

The method Ellipse displays a filled ellipse. The  center of the ellipse is specified by the parameters (cx,cy), the length of the horizontal and vertical half axes is specified by HorizAxLeng, and VertAxLeng, respectively. The color of the boundary is determined by the property DataColor; the color of the inner area is specified by the property FillColor. The line width may be adjusted by the property LineWidth.

Hint 1:	A circle may be drawn by setting HorizAxLeng and VertAxLeng to equal values (= radius of the circle). Please note, that the actual appearance depends on the scaling of the chart axes.

Hint 2:	You should avoid to draw ellipses on a logarithmic chart, since the elliptical shape is not adjusted to the logarithmic coordinate system.


Events (TRChart)
 Events

See also:

Class:	TRChart

Declaration:	property OnClick: TNotifyEvent;

property OnDblClick: TNotifyEvent;

property OnMouseMove: TMouseMoveEvent;

property OnMouseDown: TMouseEvent;

property OnMouseUp: TMouseEvent;

property OnMouseMoveInChart: TMouseMoveInChartEvent;

The OnClick and the OnDblClick events occur when the user clicks on the component. The events OnMouseMove, OnMouseDown, and OnMouseUp support the handling of the mouse. For details on these events see the Delphi documentation. The OnMouseMoveInChart event returns the mouse position in the chart coordinate system.


 FigType

See also:	XLabelType, YLabelType, UserTickTextX, UserTickTextY

Class:	TRChart

Declaration:	FigType = (ftNoFigs, ftNum, ftTime, ftNoScales, ftDateTime, ftUsertext);

The type FigType specifies the type of the inscription of an axis:

ftNoFigs	axis without figures but with scale ticks

ftNum	axis labeled by numbers

ftTime	axis labeled by a time scale

ftNoScales	no axis at all

ftDateTime	axis is labeled by date and time inscription

ftUserText	axis labeled by user defined text

Note:	The declaration of FigType has been changed with release 2.05 of RChart. All type declarations now have a leading "ft", which avoids conflicts with existing identifiers (i.e. "Time").


FindNearestItemReal (TRChart)
 FindNearestItemReal

See also:	FindNearestItemScreen

Class:	TRChart

Declaration:	function FindNearestItemReal (mx, my: double; ItemID: ItemType; ClassNumber: byte; var Dist: double): PDrawCan;

The function FindNearestItemReal searches for the item which is closest to the point [mx,my], belongs to the item type ItemID, and has a class number of ClassNumber. In order to search through all items in the linked list, ItemID should be set to tkEverything and ClassNumber must be 255. The function returns the distance Dist and a pointer to the closest item, which can be used to access the found item by means of GetItemParams, and  SetItemParams.

The distances between the reference point [mx,my] and the items of the chart are calculated using real-world coordinates. Note, that there can be a big difference between calculating the distances in the real-world and in the screen coordinate system (in case of unisotropic axes).


FindNearestItemScreen (TRChart)
 FindNearestItemScreen

See also:	FindNearestItemReal

Class:	TRChart

Declaration:	function FindNearestItemScreen (mx, my: double; ItemID: ItemType; ClassNumber: byte; var Dist: double): PDrawCan;

The function FindNearestItemScreen searches for the item which is closest to the point [mx,my], belongs to the item type ItemID, and has a class number of ClassNumber. In order to search through all items in the linked list, ItemID should be set to tkEverything and ClassNumber must be 255. The function returns the distance Dist and a pointer to the closest item, which can be used to access the found item by means of GetItemParams, and  SetItemParams.

The distances between the reference point [mx,my] and the items of the chart are calculated using screen coordinates. Note, that there can be a big difference between calculating the distances in the real-world and in the screen coordinate system (in case of unisotropic axes).


FirstItemOfLinkedList (TRChart)
 FirstItemOfLinkedList

See also:	SetItemParams, GetItemParams, PDrawCan, TDrawCan, TypeOfFirstItem

Class:	TRChart

Declaration:	function FirstItemOfLinkedList: PDrawCan;

The read-only property FirstItemOfLinkedList provides a pointer to the anchor of the linked list. This enables the user to get hold of the elements of the linked list by him/herself in order to retrieve the data of the list items.

Remark:	Generally speaking, a linked list exhibits only poor performance when storing or retrieving data (except for a sequential access to the whole list). Therefore, in most cases it is not recommended to utilise the linked list of TRChart as a data container.


Font (TRChart)
 Font

See also:	Text

Class:	TRChart

Declaration:	property Font: TFont;

The Font property controls the attributes of text used in TRChart. See the Delphi documentation for details.


FrameStyleType

See also: 	LabelFormatType, ShowNumLabel

This type declaration has been discarded with release 2.03 of RChart in order to give way to a better solution for displaying numeric labels. Numeric labels are now available in form of the visible component TNumLab.


GetItemParams (TRChart)
 GetItemParams

See also:	FindNearestItemReal, FindNearestItemScreen, SetItemParams, FirstItemOfLinkedList

Class:	TRChart

Declaration:	function  GetItemParams (Item: PDrawCan): TDrawCan;

The method GetItemParams allows to retrieve all stored parameters of a single item. The input parameter Item is a pointer to the item of interest. The function returns the parameters into a variable of the type TDrawCan. The pointer of an item can be found by using either the Next entry of TDrawCan or by using one of the methods for searching in the linked list.

Hint:	The item parameters could also be accessed directly by using its pointer. However, this is not recommended, since later releases of Rchart may not support it or may have different internal structures.


GridColor property
 GridColor

See also:	GridStyle, GridDx, GridDy

Class:	TRChart

Declaration:	property GridColor: Tcolor;

The property GridColor defines the color of the grid of the data window.


GridDx property
 GridDx

See also:	GridStyle, GridColor, GridDy

Class:	TRChart

Declaration:	property GridDx: double;

The property GridDx defines the spacing of the grid lines (points) in the x direction. GridDx may assume the following values:

> 0	grid lines are placed at integer multiples of GridDx

0	grid lines appear at every tick mark, regardless of the Range settings

for logarithmic axes GridDx may also take one of the following negative values:

-1	grid lines are located on integer powers of 10

-2	grid lines are based on a 1-2-5 scheme

-3	grid lines are drawn at the integer values 1..9 or at decadic multiples of these values.

Note, that these special modes are most suitable for logarithmic scales spanning several orders of magnitude.

Hint 1:	Do not forget to adjust the value of GridDx when switching between logarithmic and linear scales (or use GridDx = 0).

Hint 2:	If the ratio between the range of the x-axis and the grid spacing GridDx is too large, the number of displayed grid lines is restricted in order to prevent RChart from filling the date area with millions of grid lines. The maximum number of grid lines is limited to 1000 lines (dots).


GridDy property
 GridDy

See also:	GridStyle, GridColor, GridDx

Class:	TRChart

Declaration:	property GridDy: double;

The property GridDy defines the spacing of the grid lines (points) in the y direction. GridDy may assume the following values:

> 0	grid lines are placed at integer multiples of GridDy

0	grid lines appear at every tick mark, regardless of the Range settings

for logarithmic axes GridDy may also take one of the following negative values:

-1	grid lines are located on integer powers of 10

-2	grid lines are based on a 1-2-5 scheme

-3	grid lines are drawn at the integer values 1..9 or at decadic multiples of these values.

Note, that these special modes are most suitable for logarithmic scales spanning several orders of magnitude.

Hint 1:	Do not forget to adjust the value of GridDy when switching between logarithmic and linear scales (or use GridDy = 0).

Hint 2:	If the ratio between the range of the y-axis and the grid spacing GridDy is too large, the number of displayed grid lines is restricted in order to prevent RChart from filling the date area with millions of grid lines. The maximum number of grid lines is limited to 1000 lines (dots).


GridStyle property
 GridStyle

See also:	GridColor, GridDx, GridDy

Class:	TRChart

Declaration:	property GridStyle: GridStyleType;

The property GridStyle determines the type of the grid:

gsNone	No grid is displayed

gsPoints	The grid is indicated by points

gsVertLines	Vertical grid lines

gsHorizLines	Horizontal grid lines

gsLines	Both vertical and horizontal grid lines

gsHorizDotLines 	Horizontal dotted grid lines

gsVertDotLines	Vertical dotted grid lines

gsDotLines 	Both vertical and horizontal dotted grid lines


 GridStyleType

See also:	GridStyle

Class:	TRChart

Declaration:	GridStyleType = gsNone, gsPoints, gsVertLines, gsHorizLines, gsLines, gsHorizDotLines, gsVertDotLines, gsDotLines;

The type GridStyleType defines the available types of different grid lines.


Height (TRChart)
 Height

See also:	BRim, LRim, RRim, TRim, Width

Class:	TRChart

Declaration:	property Height: integer;

The property Height specifies the height of the chart window in pixels. RChart automatically restricts the minimum height of it to a value which provides at least a small strip of the graphics area. The minimum height depends on the properties BRim and TRim.


Hint (TRChart)
 Hint

See also:	ShowHint

Class:	TRChart

Declaration:	property Hint: string;

The Hint property defines the help message which is displayed when the mouse cursors stays over the control. See the Delphi documentation for details.

Note, that for the unregistered shareware version of TRChart the Hint property is automatically set to the copyright message of the component’s author. You may set the ShowHint and Hint properties during the design process, but without having any effect on the run-time component. Of course, this special feature is omitted in the registered version, and ShowHint and Hint will then function as documented in the Delphi manuals.


IdAbscissa property
 IdAbscissa

See also:	IdOrdinate, Caption

Class:	TRChart

Declaration:	property IdAbscissa: LabelStr;

The property IdAbscissa defines the label of the x-axis, which is displayed below the scale of the axis. Note, that the property BRim has to be set properly in order to leave enough room for the abscissa label. The IdAbscissa may have a maximum length of 50 characters.


IdOrdinate property
 IdOrdinate

See also:	IdAbscissa, Caption

Class:	TRChart

Declaration:	property IdOrdinate: LabelStr;

The property IdOrdinate defines the label of the y-axis, which is displayed at the upper end of the ordinate. Note, that the property TRim has to be set properly in order to leave enough room for the ordinate label. In addition, the IdOrdinate property may collide with the Caption of the chart. The IdOrdinate may have a maximum length of 50 characters.


InscriptStr type
 InscriptStr

See also:	ScaleInscriptX, ScaleInscriptY

Class:	TRChart

Declaration:	InscriptStr = string[15];

The type InscriptStr is used for the properties ScaleInscriptX, and ScaleInscriptY.


ItemType (TRChart)
 ItemType

See also:	TDrawCan, GetItemParams

Class:	TRChart

Declaration:	ItemType = (tkNone, tkMarkat, tkLine, tkLineto, tkRect, tkRectBut, tk3DBar, tkText, tkMoveTo, tkEverything, tkNotMoveTo);

This type declaration defines the various types of the items in the chart.


 LabelFormatType

See also: 	FrameStyleType, ShowNumLabel

This type declaration has been discarded with release 2.03 of RChart in order to give way to a better solution for displaying numeric labels. Numeric labels are now available in form of the visible component TNumLab.


LabelStr (TRChart)
 LabelStr

See also:	IdAbscissa, IdOrdinate

Class:	TRChart

Declaration:	LabelStr = string[50];

The type LabelStr is used for the properties IdAbscissa, and IdOrdinate


Left (TRChart)
 Left

See also:	Top

Class:	TRChart

Declaration:	property Left: Integer;

The property Left determines the horizontal coordinate of the left edge of an RChart component relative to the form in pixels.


Line (TRChart)
 Line

See also:	MoveTo, DrawTo, LineWidth

Class:	TRChart

Declaration:	procedure Line (x1,y1,x2,y2: RType);

The method Line draws a line from the point (x1,y1) to the point (x2,y2). The drawing cursor is set to the position (x2,y2). The coordinates are real coordinates of the chart window. The line width may be adjusted by the property LineWidth.


LineWidth property
 LineWidth

See also:	Line, DrawTo, Rectangle, Bar3D

Class:	TRChart

Declaration:	property LineWidth: byte;

The property LineWidth is a run-time property, which determines the line width of the following drawing items: tkLine, tkLineto, tkBar3D, and tkRectangle. The line width is specified in pixels and may assume any value between 1 and 255. The line width is set to 1 by default.


linked list (TRChart)
 Linked List

See also:	TDrawCan

The data items of a chart are stored internally as a linked list, which can be accessed by the user by some of the methods of TRChart. An element of the linked list is defined by the type TDrawCan.

Methods and properties related to the treatment of the linked list:

FindNearestItemReal

FindNearestItemScreen

FirstItemOfLinkedList

GetItemParams

LoadLinkedList

RemoveFirstItem

RemoveLastItem

SetItemParams

SaveLinkedList

SaveLinkedListASC

TypeOfFirstItem

TypeOfLastItem

The figure below should clarify the set-up of the linked list. The property FirstItemOfLinkedList returns a pointer to the first element. The last element in the list has the Element field set to tkNone. Thus there is always one excess element, which is empty and which is used as a terminator of the linked list.

Here’s a small code snippet how to scan through the linked list by yourself:

var

  np      : PDrawCan;

begin

np := FirstItemOfLinkedList;     { set pointer to first item}

while np^.Element <> tkNone do   { loop through all items }

  begin

     { here goes your code to process the

       individual items of the linked list:

       any item should be referenced by the

       pointer np }

  np := np^.Next;                { set pointer to next item }

  end;

end;


LogScaleX property
 LogScaleX

See also:	LogScaleY

Class:	TRChart

Declaration:	property LogScaleX: boolean;

The property LogScaleX defines the type of scaling used for the x-axis. If LogScaleX is set to TRUE, logarithmic scales are used, otherwise the data are displayed on a linear scale. Changing this property automatically redraws the whole graphics using the newly selected mode. Any items which have negative or zero coordinates are not plotted at all.

Hint:	LogScaleX can be set to TRUE only if both RangeLoX and RangeHiX are positive and greater than zero. In the case of negative scales the setting of the LogScaleX property will not have any effect and LogScaleX is automatically reset to FALSE.


LogScaleY property
 LogScaleY

See also:	LogScaleX

Class:	TRChart

Declaration:	property LogScaleY: boolean;

The property LogScaleY defines the type of scaling used for the y-axis. If LogScaleY is set to TRUE, logarithmic scales are used, otherwise the data are displayed on a linear scale. Changing this property automatically redraws the whole graphics using the newly selected mode. Any items which have negative or zero coordinates are not plotted at all.

Hint:	LogScaleY can be set to TRUE only if both RangeLoY and RangeHiY are positive and greater than zero. In the case of negative scales the setting of the LogScaleY property will not have any effect and LogScaleY is automatically reset to FALSE.


LRim property
 LRim

See also:	BRim, RRim, TRim, Height, Width

Class:	TRChart

Declaration:	property LRim: integer;

The property LRim specifies the distance between the left boundary of the chart window and the chart drawing area. The distance LRim is specified as the number of pixels between the two boundaries.


 LoadLinkedList

See also:	SaveLinkedList

Class:	TRChart

Declaration:	procedure LoadLinkedList (FName: string; AppendIt: boolean);

The method LoadLinkedList loads the linked list of RChart from a file which has been created by a previous call to SaveLinkedList. The parameter AppendIt determines whether the loaded graphics items are appended to the existing ones, or the linked list is cleared before loading the items. LoadLinkedList together with SaveLinkedList may be used to create templates of graphics.

Note:	The method LoadLinkedList is not available with the 16-bit Delphi version of RChart.


M2R method
 M2R

See also:	R2M

Class:	TRChart

Declaration:	procedure M2R (xin,yin: longint; var xout,yout: double);

The routine M2R allows the transformation of integer screen (pixel) coordinates into the real-world coordinates of a chart. The parameters xin and yin specify the pixel coordinates of the chart window (not the data area) - therefore the properties LRim and TRim should be taken into account when using M2R. The variable parameters xout and yout return the real-world coordinates of the point [xin, yin].

Hint:	Normally, the user will not utilize this method at all. M2R has been declared public in order to give direct access to the chart area for special purposes.


 MarkAllItems

See also:	MarkItemsInWindow, class numbers

Class:	TRChart

Declaration:	procedure MarkAllItems (ItemID: ItemType; ClassNumber: byte);

The method MarkAllItems sets the class number of all available items of the type ItemID to the value ClassNumber. The parameter ClassNumber must not be set to 255. In this case the procedure MarkAllItems has no effect at all.


MarkAt (TRChart)
 MarkAt

See also:	Text

Class:	TRChart

Declaration:	procedure MarkAt (x,y: RType; mk: byte);

The method MarkAt displays a mark at the position (x,y) using the color DataColor. The shape of the mark is defined by the parameter mk (valid values from 0 to MaxRcMarks, see figure below).


 MarkItemsInWindow

See also:	MarkAllItems, class numbers

Class:	TRChart

Declaration:	function  MarkItemsInWindow (xLo, YLo, XHi, YHi: double; ItemID: ItemType; ClassNumber: byte): longint;

The method MarkItemsInWindow searches for all entries in the linked list which fullfil the following requirements: the item must be of the type ItemID, and the item has to be located within a window which is defined by the parameters xLo...YHi. If an item meets the requirements, its class number is set to the value ClassNumber.  The boundaries of the restricting window (xLo, yLo, xHi, yHi) are specified as real-world coordinates. The function returns the number of items which have been marked by a new class number.

Hint:	The parameter ClassNumber must not be set to 255 (in this case the function ltemsInWindow has no effect at all).


MinTickX property
 MinTickX

See also:	MinTickY, ShortTicksX, XLabelType

Class:	TRChart

Declaration:	property MinTickX: integer;

The property MinTickX determines the minimum number of ticks on the x-axis which have to carry numeric labels. MinTickX is valid between 2 and 10.


MinTickY property
 MinTickY

See also:	MinTickX, ShortTicksY, YLabelType

Class:	TRChart

Declaration:	property MinTickY: integer;

The property MinTickY determines the minimum number of ticks on the y-axis which have to carry numeric labels. MinTickY is valid between 2 and 10.


MouseActMode (TRChart)
 MouseActMode

See also:	MouseAction, ZoomState

Class:	TRChart

Declaration:	MouseActMode = (maNone, maPan, maZoomWind, maZoomWindPos, maZoomDrag);

The type definition MouseActMode lists the possible mouse actions which are available within the data window of a chart:

maNone	no special action at all

maPan	panning the data

maZoomWind	zooming into a rectangular region of the data

maZoomWindPos	zooming into a rectangular region of the data (resulting in axes with positive directions from left to right and from bottom to top)

maZoomDrag	zooming in and out by dragging the mouse


MouseAction (TRChart)
 MouseAction

See also:	ConfineZoomRange, MouseBox, MouseCursorFixed, ZoomHistory

Class:	TRChart

Declaration:	property MouseAction: MouseActMode;

The property MouseAction facilitates interactive zooming and panning of the data. This property may take the following five possible values. The kind of mouse action is indicated by different cursors (if MouseCursorFixed is set to FALSE).

maNone	No built-in interaction is possible. The only way to apply a mouse controlled action is by utilizing the mouse events.

maPan	The data display can be panned by pressing and holding the left mouse button. The data image will then follow the mouse movement.

maZoomWind	The user can zoom into a rectangular region of the data display. Therefore he has to press and hold down the left mouse button at the first corner of the intended region. Thereafter a rectangle follows the mouse cursor indicating the region to be zoomed. Releasing the left button selects this region and zooms into the data by displaying exactly this region. Note, that the direction of an axis is reversed if the first point is higher the second point. In order to avoid this effect, use the mode maZoomWindPos.

maZoomWindPos	This is a special version of maZoomWind which prevents the zoom mechanism from turning the direction of an axis in case of a selection window which has been defined from right to left and/or from top to bottom (i.e. the first point corner of the rectangle is located to the right of and/or above the second point).

maZoomDrag	This mode enables the user both to increase and to decrease the magnification factor of the graph. The left mouse button has to be pressed and held down. The magnification of the data image will then follow the mouse movement. Moving to the left and/or bottom zooms out of the data; moving to the right and/or top zooms into the data.

Hint 1:	In order to switch safely to the default cursor, if the mouse moves outside the component window, the parent form should use the OnMouseMove event to execute the following statement:

SCreen.Cursor := crdefault;

This ensures that the mouse cursor is reset to its default image when leaving the chart.

Hint 2:	These interactive modes will function smoothly only on a powerful computer with a proper graphics card.

Hint 3:	The mouse cursors associated with the different mouse actions are allocated once during the creation of a chart. Additional charts will use the cursor resources of the first chart. However these resources are released only when the application exits. Thus the heap is loaded by 48 extra bytes even if all of the RChart components are destroyed.

Hint 4:	The various chart ranges are stored in a zoom history list after each zoom or pan action. Thus you could restore the previous range by using the method ZoomHistory.


 MouseBox

See also:	MouseAction

Class:	TRChart

Declaration:	function Mousebox (var xLo, yLo, xHi, yHi: double): boolean;

The function MouseBox allows to select a rectangular region of the data. The user can select a region by clicking the left mouse button in order to specify the first corner of the intended rectangle. Thereafter a rubber-band rectangle follows the mouse cursor. This rectangle can be selected by clicking the left mouse button again. The selection process may be aborted at any time by simply pressing the right mouse button.

The function MouseBox returns a TRUE value if the selection is valid; the real-world coordinates of the rectangular region are then contained in the parameters xLo ... yHi.


MouseCursorFixed property
 MouseCursorFixed

See also:	Cursor, MouseAction, CrossHairSetPos

Class:	TRChart

Declaration:	property MouseCursorFixed: boolean;

The property MouseCursorFixed determines whether the mouse cursor changes according to the currently active mouse action. If MouseCursorFixed is set to TRUE, the mouse cursor does not change and always the default cursor icon as set by the property Cursor.


MousePosX property
 MousePosX

See also:	MousePosY, TMouseMoveInChartEvent

Class:	TRChart

Declaration:	property MousePosX: double;

This is a read-only property and returns the x-value of the current mouse position in terms of real-world chart coordinates. If the mouse is not over the chart window, MousePosX is not updated. In this case it returns the last coordinate value which has been obtained before the mouse has left the chart area.


MousePosY property
 MousePosY

See also:	MousePosX, TMouseMoveInChartEvent

Class:	TRChart

Declaration:	property MousePosY: double;

This is a read-only property and returns the y-value of the current mouse position in terms of real-world chart coordinates. If the mouse is not over the chart window, MousePosY is not updated. In this case it returns the last coordinate value which has been obtained before the mouse has left the chart area.


MoveTo (TRChart)
 MoveTo

See also:	Line, DrawTo

Class:	TRChart

Declaration:	procedure Moveto (x,y: RType);

The method MoveTo moves the drawing cursor to the point (x,y). The coordinates are real coordinates of the chart window.


MXTrackOn property
 MXTrackOn

See also:	OnMouseMoveInChart

This property has been discarded with release 2.03 of RChart in order to give way to a better solution using the special event OnMouseMoveInChart.


MYTrackOn property
 MYTrackOn

See also:	OnMouseMoveInChart

This property has been discarded with release 2.03 of RChart in order to give way to a better solution using the special event OnMouseMoveInChart.


MXLabFormat property
 MXLabFormat

See also:	OnMouseMoveInChart

This property has been discarded with release 2.03 of RChart in order to give way to a better solution using the special event OnMouseMoveInChart.


MYLabFormat property
 MYLabFormat

See also:	OnMouseMoveInChart

This property has been discarded with release 2.03 of RChart in order to give way to a better solution using the special event OnMouseMoveInChart.


RCHART
RChart - Version 4.01

This component has been awarded the   Delphi Choice '96    award from The Delphi Information Connection

The unit RChart contains a Delphi visual component which supports the display of scientific graphs. The component is named TRChart and comes together with this help file and several example programs. RChart is released under the shareware concept. The unregistered version is fully functional with two exceptions: (1) the Hint property is disabled; instead of a user-defined hint the copyright message of the author is automatically displayed. (2) The shareware version runs only when the Delphi IDE is also up and running.

Using TRChart

Interface section of RChart

Installing TRChart to your component library

Registration of the component

Delphi and C++Builder issues

Frequently asked questions

Details on TRChart:

Public constants

Public type declarations

Methods

Properties

Events


 FillColor

See also:	ChartColor, ScaleColor, DataColor, WindColor

Class:	TRChart

Declaration:	property FillColor: TColor;

The property FillColor determines the color used for filling the following data items: Bar3D, Rectangle, RectFrame, and Ellipse. The color is stored internally along with the graphics objects so that each graphics object can have a different color. See the Delphi documentation for details on the TColor type.

Hint:	Try to avoid situations where the colors of the data items are permanently changed during the drawing process. This will slow down graphics by up to 20 %. Instead, data items of the same color should be drawn, and then the items of the next colors and so on.


 FindMinMax

See also:	AutoRange, SetRange

Class:	TRChart

Declaration:	procedure FindMinMax (RangeLoX, RangeLoY, RangeHiX, RangeHiY: double; var MinX, MinY, MaxX, MaxY: double);

The method FindMinMax finds the minimum and the maximum coordinates of all graphic elements in the range defined by the parameters RangeLoX ... RangeHiY. The minimum and maximum x and y values are returned in the variable parameters MinX, MinY, MaxX, and MaxY. The method FindMinMax enables the user to set the visible range of the chart in a way that all elements are visible within a given area.

Example:	The following sample code finds the extreme values of the chart elements in the range [20,-RcMaxDouble] to [40,+RcMaxDouble] and sets the visible range such that all elements in the specified range are fully displayed.

var

  xLo, yLo, xHi, yHi: double;

begin

RChart1.FindMinMax (20,-RcMaxDouble,40, RcMaxDouble, xLo, yLo, xHi, yHi);

RChart1.SetRange (xLo, yLo, xHi, yHi);

end;


DataTag (RChart)
 DataTag

See also:	Tag, TDrawCan, GetItemParams, ColorData

Class:	TRChart

Declaration:	property DataTag: longint;

The property DataTag contains a longint value which can be set by the user according to his or her needs. The value of the DataTag is stored along with other information much in the same way as the color of an element. The tag of an individual element can be retrieved by the method GetItemParams.

Please note the difference between the Tag and the DataTag property. While the Tag property is available once per component, the DataTag property is a tag which is individually assigned to each graphics element.

The DataTag can be especially useful to relate any graphics elements to external information. The following code shows how to store a serial number along with each element drawn:

....

for i:=1 to 200 do

  begin

  RChart.DataTag := i;

  RChart.MarkAt (x,y,z,10);

  end;

....

Each of the 200 hundred marks has now its own serial number.


Public Constants (RChart)
Public Constants

defLRim = 50;	default left rim

defRRim = 10;	default right rim

defTRim = 16;	default top rim

defBRim = 32;	default bottom rim

defShadowWidth = 0;	default width of shadow

defDataCol  = clblack;	default data color

defScaleCol = clBlack;	default scale color

defChartCol = clWhite;	default chart background color

defWindCol  = clSilver;	default window background color

defGridCol  = clBlack;	default grid color

defLineWid  = 1;	default line width

defRCHeight = 160;	default height

defRCWidth  = 240;	default width

defBndLoX: double = 0.0;	default boundaries of scaled area: lower x

defBndLoY: double = 0.0;	lower y

defBndHiX: double = 10.0;	upper x

defBndHiY: double = 10.0;	upper y

defDecPlcX = 1;	nr. of dec. places on x-axes

defDecPlcY = 1;	nr. of dec. places on y-axes

defNXTick = 3;	number of ticks on x axis

defNYTick = 3;	number of ticks on y axis

MaxRCMarks = 25;	number of available mark symbols

MinRCWidth = 50;	minimum width of RChart data area

MinRCHeight = 10;	minimum height of RChart data area

MaxTickPos = 50;	maximum number of synchronized tick marks

MaxZoomStack = 8;	maximum length of (circular) zoom history stack

MaxCrossH = 4;	number of available crosshairs


 ClassVisible

See also:	class numbers, ClassDefault

Class:	TRChart

Declaration:	property ClassVisible[cnum: byte]: boolean;

The array property ClassVisible determines whether any items of the class cnum are displayed or not. The parameter cnum may take any value between 0 and 254. The value of 255 is reserved as a place holder for all classes.

This property may be used to temporarily "switch off" parts of the data in a chart. Please note, that ClassVisible only affects the display of the data. Items which have been made invisible can be processed like any other visible items.


 AutoRange

See also:	SetRange, FindMinMax

Class:	TRChart

Declaration:	procedure AutoRange (rim: double);

The method AutoRange sets the bounds of the chart axes such, that all graphics elements are visible and the directions of the axes are positive. The parameter rim specifies an optional rim in percent of the chart area. Values between 2 and 5 percent usually deliver good results.

Please note that the width of lines, and the extents of text elements are not included into the autoranging calculations. This implies that lines with a width greater than 1 may be displayed only partly (if the line element is the most outward element). The same is true for texts which may be shown only partly since the text reference point depends on the TextAlignment property.


 CrossHairSetPos

See also:	CrossHairPosX, CrossHairPosY, Cursor, MouseAction, CrossHairSetup

Class:	TRChart

Declaration:	procedure CrossHairSetPos (chnum: integer; x,y: double);

The method CrossHairSetPos sets the position of the crosshair chnum to the position [x,y]. The parameter chnum is the number of the crosshair to be set (1..4). The crosshair will be visible in the chart if the crosshair is switched on and is set within the visible range of the chart). The kind of crosshair can be controlled by the method CrossHairSetup.

Note:	Switching on any of the crosshairs on slows down panning and zooming by approx. 30 %

Hint:	A crosshair may be used as a mouse cursor by simply calling CrossHairSetPos in the OnMouseMoveInRChart event.


 CrossHairSetup

See also:	Cursor, MouseAction, CrossHairSetPos, TCrossHMode

Class:	TRChart

Declaration:	procedure CrossHairSetup (ch: integer; chColor: TColor; Mode: TCrossHMode; LineType: TPenStyle; LineWidth: integer);

RChart provides up to four independent crosshair cursors which may be displayed in addition to the data. These crosshairs are not part of the linked list and may be configured and utilized by using the methods CrossHairSetup and CrossHairSetPos. The method CrossHairSetup defines various parameters of a particular crosshair ch:

chColor	Color of the crosshair

Mode	Type of crosshair cursor: Mode may take one of the following values:

chOff (crosshair is switched off)

chHoriz (horizontal line across the chart)

chVert (vertical line across the chart)

chBoth (crosshair)

LineType	Pen style for crosshair: LineType may assume one of the following values:

psSolid (sloid line)

psDot (dotted line)

psDash (dashed line)

psDashDot (dash-dot combinations)

psDashDotDot (series of dash-dot-dot combinations)

Note that the LineType will be effective only if LineWidth is set to 1

LineWidth	Line width of the crosshair. Note that lines broader than 1 will always be drawn as solid line, even if LineType is set to some other value.

Hint:	Switching on any of the crosshairs on slows down panning and zooming by approx. 30 %


 CrossHairPosX

See also:	CrossHairPosY, CrossHairSetPos, MousePosX

Class:	TRChart

Declaration:	property CrossHairPosX [chnum: integer]: double;

The array property CrossHairPosX defines the x-position of the crosshair chnum.The parameter chnum may take values between 1 and MaxCrossH (currently 4). Any invalid values of chnum will be ignored when setting the property, or will result in a returned zero value when reading the property.

Hint:	If you want to set both the x- and the y-coordinate of the crosshair you should use the method CrossHairSetPos instead of CrossHairPosX and CrossHairPosY. This would be faster than using the individual properties.


 CrossHairPosY

See also:	CrossHairPosX, CrossHairSetPos, MousePosY

Class:	TRChart

Declaration:	property CrossHairPosY [chnum: integer]: double;

The array property CrossHairPosY defines the y-position of the crosshair chnum.The parameter chnum may take values between 1 and MaxCrossH (currently 4). Any invalid values of chnum will be ignored when setting the property, or will result in a returned zero value when reading the property.

Hint:	If you want to set both the x- and the y-coordinate of the crosshair you should use the method CrossHairSetPos instead of CrossHairPosX and CrossHairPosY. This would be faster than using the individual properties.


AutoRedraw property
 AutoRedraw

See also:	ShowGraf

Class:	TRChart

Declaration:	property AutoRedraw: boolean;

Normally, any action which changes the layout of the chart (for example altering the background color, or changing the displayed range) automatically triggers a redrawing of the chart. While this feature can be quite helpful under most circumstances, there are some applications where the automatic redraw is undesired, since it considerably slows down the drawing process.

For that purpose the automatic redrawing can be switched off by setting the AutoRedraw property to false. In this case the whole chart is only redrawn when the method ShowGraf is called.


 CopyToOpenPrinterHiRes

See also:	CopyToOpenPrinter, PrintItHiRes

Class:	TRChart

Declaration:	procedure CopyToOpenPrinterHiRes (var x,y: integer; ScaleF: double; BlkWhite: boolean);

The method CopyToOpenPrinterHiRes is a more flexible alternative to the method PrintItHiRes. It provides a way to create a graphical output on the currently selected printer. You may change the selected printer by assigning a proper value to the PrinterIndex property of the Printer object before calling CopyToOpenPrinterHiRes. In contrast to PrintItHiRes, the user has to take care by himself that the printer object is already open for receiving data. This can be accomplished either by the method Printer.BeginDoc (see Delphi manual for details), or by assigning the printer output to a text file (Delphi procedure AssignPrn).

The variable parameters x and y contain the coordinates of the upper left corner of the chart in printer coordinates on entry of the routine, and return the printer coordinates of the lower right corner of the chart after the method is finished. This feature can be used to combine several hardcopies on one page, since the x- and y-values after a first hardcopy can be partly used as inputs of the next hardcopy.

The parameter ScaleF determines the magnification factor of the printout. A factor of 1.0 creates an output which has roughly the size of the screen image (assuming a monitor resolution of 80 dots per inch). If the parameter BlkWhite is set to TRUE, the colors of the chart are suppressed and the chart is printed in black and white. This is normally the best way to proceed with B&W printers.

Important Hint:	There are a few restrictions concerning the printout created by CopyToOpenPrinterHiRes. These restrictions are due to some bugs (or "features") in the Windows graphics library and in some printer drivers: (1) dashed lines (as in grid lines) are printed as solid lines; (2) light colors are not printed at all on some black and white printers; (3) flying shadows are not printed properly on some printers; (4) text items are not properly clipped at the chart borders on some printers; (5) due to an additonal bug in the Delphi 2.0 graphics library, the font sizes for labels and the caption are improperly set in Delphi 2.0 applications.

Example 1:	The following code snippet shows a short example how to mix several graphics and some text on one printer page.

  Printer.BeginDoc;

  Printer.Canvas.TextOut (300,180,'This is some text');

  Printer.Canvas.TextOut (300,240,'Another text line');

  x := 100;

  y := 270;

  RChart1.CopyToOpenPrinterHiRes (x,y, 0.8, true);   { the first chart }

  Printer.Canvas.TextOut (300,y+20,'Yet another line of text');

  x := 10;

  y := y+80;

  RChart1.CopyToOpenPrinterHiRes (x,y, 0.4, true);  { the second chart }

  Printer.EndDoc;

Example 2:	A full featured example using the method CopyToOpenPrinterHiRes can be found in the sample program PRINTCHT.DPR which is delivered with the RChart package.


 NewColorOfClassItems

See also:	ScaleSelectedItems

Class:	TRChart

Declaration:	procedure NewColorOfClassItems (Newcol: TColor; ClassNumber: byte);

The method NewColorOfClassItems assigns the color NewCol to all items in the drawing which have the class number ClassNumber. If the parameter ClassNumber is set to 255, all graphics items are processed.


OnMouseMoveInChart event
 OnMouseMoveInChart

See also:	TMouseMoveInChartEvent, other events

Class:	TRChart

Declaration:	OnMouseMoveInChart: TMouseMoveInChartEvent;

The event OnMouseMoveInChart occurs when the mouse cursor is moved within the chart window area. See TMouseMoveInChartEvent for a detailed description of the event.


PDrawCan (TRChart)
 PDrawCan

See also:

Class:	TRChart

Declaration:	PDrawCan  = ^TDrawCan;

This type declaration defines a pointer of the type TDrawCan.


PopupMenu (TRChart)
 PopupMenu

See also:

Class:	TRChart

Declaration:	property PopupMenu: TPopupMenus;

The PopupMenu property identifies the pop-up menu that appears when you select RChart and press the right mouse button, or when the Popup method of the pop-up menu is called. In order to assign a pop-up menu to RChart, you first have to create a pop-up menu by dragging it from the VCL component bar.


PrintIt (TRChart)
 PrintIt

See also:	PrintItHiRes, CopyToOpenPrinter

Class:	TRChart

Declaration:	procedure PrintIt (ScaleF: double; BlkWhite: boolean);

The method PrintIt provides a way to create a hardcopy on the currently selected printer. You may change the selected printer by assigning a proper value to the PrinterIndex property of the Printer object before calling PrintIt. The parameter ScaleF determines the magnification factor of the printout. A factor of 1.0 creates an output which has roughly the size of the screen image (assuming a monitor resolution of 80 dots per inch). If the parameter BlkWhite is set to TRUE, the colors of the chart are suppressed and the chart is printed in black and white. This is normally the best way to proceed with B&W printers.

Note, that PrintIt prints only the chart and its contents but not any auxiliary elements such as the crosshairs, or the mouse cursor.

Hint:	In order to mix text and graphics, or to print several graphics on one page, the procedure CopyToOpenPrinter should be used.


R2M method
 R2M

See also:	M2R

Class:	TRChart

Declaration:	procedure R2M (xin,yin: double; var xout,yout: longint);

The routine R2M allows the transformation of real-world chart coordinates into integer screen (pixel) coordinates. The parameters xin and yin specify the real-world coordinates of the chart. The variable parameters xout and yout contain the pixel coordinates of the point [xin, yin]. Note, that the returned coordinates are pixel coordinates of the chart window (not the data area) - therefore the properties LRim and TRim should be taken into account when using R2M.

Hint:	Normally, the user will not utilize this method at all. R2M has been declared public in order to give direct access to the chart area for special purposes.


RangeLoX property
 RangeLoX

See also:	RangeLoY, RangeHiX, RangeHiY, AutoRange, SetRange

Class:	TRChart

Declaration:	property RangeLoX: double;

The property RangeLoX specifies the left most value of the x-axis (usually the lower value of the scale). If the new value of RangeLoX would result in an x-axis with no extents (RangeHiX = RangeLoX) then both RangeLoX and RangeHiX are automatically adjusted to span a range of +/- 1.0 around RangeHiX.

Hint:	The direction of the axis can be switched by specifying RangeLoX larger than RangeHiX.


RangeLoY property
 RangeLoY

See also:	RangeLoX, RangeHiX, RangeHiY, AutoRange, SetRange

Class:	TRChart

Declaration:	property RangeLoY: double;

The property RangeLoY specifies the bottom value of the y-axis (usually the lower value of the scale). If the new value of RangeLoY would result in an y-axis with no extents (RangeHiY = RangeLoY) then both RangeLoY and RangeHiY are automatically adjusted to span a range of +/- 1.0 around RangeHiY.

Hint:	The direction of the axis can be switched by specifying RangeLoY larger than RangeHiY.


RangeHiX property
 RangeHiX

See also:	RangeLoX, RangeLoY, RangeHiY, AutoRange, SetRange

Class:	TRChart

Declaration:	property RangeHiX: double;

The property RangeHiX specifies the right most value of the x-axis (usually the higher value of the scale). If the new value of RangeHiX would result in an x-axis with no extents (RangeHiX = RangeLoX) then both RangeLoX and RangeHiX are automatically adjusted to span a range of +/- 1.0 around RangeLoX.

Hint:	The direction of the axis can be switched by specifying RangeHiX smaller than RangeLoX.


RangeHiY property
 RangeHiY

See also:	RangeLoX, RangeLoY, RangeHiX, AutoRange, SetRange

Class:	TRChart

Declaration:	property RangeHiY: double;

The property RangeHiY specifies the top value of the y-axis (usually the higher value of the scale). If the new value of RangeHiY would result in an y-axis with no extents (RangeHiY = RangeLoY) then both RangeLoY and RangeHiY are automatically adjusted to span a range of +/- 1.0 around RangeLoY.

Hint:	The direction of the axis can be switched by specifying RangeHiY smaller than RangeLoY.


Rectangle method
 Rectangle

See also:	Bar3D, RectFrame, Ellipse

Class:	TRChart

Declaration:	procedure Rectangle (x1, y1, x2, y2: RType);

The method Rectangle displays a filled rectangle. The lower left corner and the upper right corner are specified by the positions (x1,y1) and (x2,y2), respectively. The color of the boundary is determined by the property DataColor; the color of the inner area is specified by the property FillColor. The line width may be adjusted by the property LineWidth.


RectFrame method
 RectFrame

See also:	Bar3D, Rectangle, TRFrameStyle

Class:	TRChart

Declaration:	procedure RectFrame (x1,y1, x2, y2: double; FrameStyle: TRFrameStyle; ShadowColor, HiLightColor: TColor);

The method RectFrame displays a framed rectangle. The lower left corner and the upper right corner are specified by the positions (x1,y1) and (x2,y2), respectively. The frame may assume one of four styles (parameter FrameStyle):

rbLowered

rbRaised

rbEmbossed

rbEngraved

The colors of the boundary are determined by the parameters ShadowColor, and HiLightColor, the color of the inner area is determined by the property FillColor. The line width of the boundary is always 1 pixel.


RemoveFirstItem (TRChart)
 RemoveFirstItem

See also:	RemoveLastItem, TypeOfFirstItem, RemoveItem

Class:	TRChart

Declaration:	procedure RemoveFirstItem;

The method RemoveFirstItem deletes the first graphics element from the linked list. This is equal to remove the first element from the drawing. Note that you have to call the method ShowGraf in order to see any effect.

Hint:	RemoveFirstItem can be used to create running graphs by repeatedly removing the first element and draw a new one at the end of the graph.

Example:	RCHFIFO.DPR

This example program shows how to implement a running graph.


RemoveLastItem (TRChart)
 RemoveLastItem

See also:	RemoveFirstItem, TypeOfLastItem, RemoveItem

Class:	TRChart

Declaration:	procedure RemoveLastItem;

The method RemoveLastItem deletes the last graphics element from the linked list. This is equal to remove the last element from the drawing. Note that you have to call the method ShowGraf in order to see any effect.

Hint:	RemoveLastItem can be used to move a graphics element across an existing drawing by repeatedly removing the last element and regenerating it at a different location.

Example:	RCHMOVEL.DPR

This example program shows how to utilize RemoveLastItem for moving an item of the chart.


RRim property
 RRim

See also:	BRim, LRim, TRim, Height, Width

Class:	TRChart

Declaration:	property RRim: integer;

The property RRim specifies the distance between the right boundary of the chart window and the chart drawing area. The distance RRim is specified as the number of pixels between the two boundaries.


 SaveLinkedList

See also:	SaveLinkedListASC, LoadLinkedList

Class:	TRChart

Declaration:	procedure SaveLinkedList (FName: string);

The method SaveLinkedList saves the contents of the linked list into a binary file which may be reloaded by the method LoadLinkedList. Using SaveLinkedList provides therefore a way to store some common graphics on disk and reloading it into the chart at a later point.

Hint:	You should not rely on this method to store data over longer periods of time, since the internal format of the file may change with future releases of RChart.

Note:	The method SaveLinkedList is not available with the 16-bit Delphi version of RChart.


 SaveLinkedListASC

See also:	SaveLinkedList

Class:	TRChart

Declaration:	procedure SaveLinkedListASC (FName: string);

The method SaveLinkedListASC saves the contents of the linked list into a readable ASCII text file. This method is for debugging purposes only, normally the user should utilize the method SaveLinkedList in order to save a linked list to a file.

Note:	The method SaveLinkedListASC is not available with the 16-bit Delphi version of RChart.


 ScaleAllItems

See also:	ScaleItem, ScaleSelectedItems

Class:	TRChart

Declaration:	procedure ScaleAllItems (kx, dx, ky, dy: double);

The procedure ScaleAllItems transforms the positions of all available items according to the following equations:

newx := oldx * kx + dx

newy := oldy * ky + dy

The parameters kx and ky could be set to zero values in order to simply shift the graphics items on the chart.

Hint:	This type of transformation should not be mixed up with range-scaling of the axes (i.e. zooming and panning). Scaling the item positions means changing their positions in the real-world coordinate system. In contrast to this, the alteration of the range of the axes (by using e.g. SetRange) changes the coordinate system but not the positions of the items.


 ScaleInscriptX

See also:	ScaleInscriptY, UserTickTextX

Class:	TRChart

Declaration:	property ScaleInscriptX: InscriptStr;

The property ScaleInscriptX allows to add extra text to the scale inscription of the x axis. The text may lead the numeric labels, or follow it, or even embed it. The position of the numeric label within the extra text can be specified by an "&" character in the text. The & character is a place holder for the numeric value and is replaced by it on the chart. The extra text may have a maximum length of 15 characters (including the & place holder).

Example:	The figure below shows an example of how to include the characters "dB" (decibel) with each numeric value on the axis. The property ScaleInscriptX is therefore set to "& dB".


 ScaleInscriptY

See also: 	ScaleInscriptX, UserTickTextY

Class:	TRChart

Declaration:	property ScaleInscriptY: InscriptStr;

The property ScaleInscriptY allows to add extra text to the scale inscription of the y axis. The text may lead the numeric labels, or follow it, or even embed it. The position of the numeric label within the extra text can be specified by an "&" character in the text. The & character is a place holder for the numeric value and is replaced by it on the chart. The extra text may have a maximum length of 15 characters (including the & place holder).

Example:	See the property ScaleInscriptX.


 ScaleItem

See also:	ScaleAllItems, ScaleSelectedItems

Class:	TRChart

Declaration:	procedure ScaleItem (Item: PDrawCan; kx, dx, ky, dy: double);

The procedure ScaleItem transforms the position of the graphics element Item according to the following equations:

newx := oldx * kx + dx

newy := oldy * ky + dy

The item is accessed via its pointer. Normally this pointer is retrieved by other methods like FindNearestItemReal. The parameters kx and ky could be set to zero values in order to simply shift the graphics item on the chart. In order to achieve non-linear transformations, the items should accessed on an individual basis by using the methods GetItemParams and SetItemParams.

Hint:	This type of transformation should not be mixed up with range-scaling of the axes (i.e. zooming and panning). Scaling the item positions means changing their positions in the real-world coordinate system. In contrast to this, the alteration of the range of the axes (by using e.g. SetRange) changes the coordinate system but not the positions of the items.


 ScaleSelectedItems

See also:	ScaleAllItems, ScaleItem, NewColorOfClassItems

Class:	TRChart

Declaration:	procedure ScaleSelectedItems (kx, dx, ky, dy: double; ClassNumber: byte);

The procedure ScaleSelectedItems transforms the positions of all items with the class number ClassNumber according to the following equations:

newx := oldx * kx + dx

newy := oldy * ky + dy

The parameters kx and ky could be set to zero values in order to simply shift the graphics items on the chart.

Hint:	This type of transformation should not be mixed up with range-scaling of the axes (i.e. zooming and panning). Scaling the item positions means changing their positions in the real-world coordinate system. In contrast to this, the alteration of the range of the axes (by using e.g. SetRange) changes the coordinate system but not the positions of the items.


ScaleColor property
 ScaleColor

See also:	ChartColor, DataColor, WindColor

Class:	TRChart

Declaration:	property ScaleColor: TColor;

The property ScaleColor defines the color of the axes and the frame around the chart area. Note, that the color of the inscription of the axes is controlled by the Color property of the Font property.


ShadowBakColor property
 ShadowBakColor

See also:	ShadowColor, ShadowStyle, ShadowWidth

Class:	TRChart

Declaration:	property ShadowBakColor: TColor;

The property ShadowBakColor determines the color of the background of the shadow. The ShadowBakColor has to be set to the color of the surrounding area, in order to get a proper impression of the shadow.


ShadowColor property
 ShadowColor

See also:	ShadowBakColor, ShadowStyle, ShadowWidth

Class:	TRChart

Declaration:	property ShadowColor: TColor;

The property ShadowColor determines the color of the shadow.

Note, that the shadow is only visible if the property ShadowWidth is greater than zero.


ShadowStyle property
 ShadowStyle

See also:	ShadowBakColor, ShadowColor, ShadowWidth

Class:	TRChart

Declaration:	property ShadowStyle: TShadowStyle;

The property ShadowStyle determines the type of the shadow of the chart component. Two different styles are available: ssBox and ssFlying (see the figure below to see the differences).

Note, that the shadow is only visible if the property ShadowWidth is greater than zero.


ShadowWidth property
 ShadowWidth

See also:	ShadowBakColor, ShadowColor, ShadowStyle

Class:	TRChart

Declaration:	property ShadowWidth: integer;

The property ShadowWidth determines the width of the shadow of the chart component. The width may vary between 0 and 32. The default value is zero.


SetItemParams (TRChart)
 SetItemParams

See also:	FindNearestItemReal, FindNearestItemScreen, FirstItemOfLinkedList, GetItemParams, ScaleAllItems, ScaleAllItems, ScaleSelectedItems

Class:	TRChart

Declaration:	procedure SetItemParams (Item: PDrawCan; ItParams: TDrawCan);

The method SetItemParams sets the parameters of a single item. The input parameter Item is a pointer to the item of interest. The parameter ItParams is of the type TDrawCan and contains the information on the item. The variable Next of ItParams is not used and should be set to NIL. The procedure SetItemParams is not exceuted at all if the item type (variable Element) is set to tkNone or tkEverything.

Hint:	Do not set the parameters of an item directly via its pointer, since this may lead to unresolvable problems with future versions of TRChart.

Example:	For the following example suppose that the user has clicked the mouse somewhere on the chart area. The code below shows how to change the color of the nearest item on the chart to a blue color.

var

  ItemP : PDrawCan;

  ItPar : TDrawCan;

  dist  : double;

begin

with RChart1 do

  begin

  ItemP := FindNearestItemScreen (MousePosX, MousePosY, tkEverything, 255, dist);

  if ItemP <> NIL then

    begin

    Itpar := GetItemParams (Itemp);

    ItPar.Color := clLime;

    SetItemParams (ItemP, ItPar);

    ShowGraf;

    end;

  end;

end;


SetRange method
 SetRange

See also:	AutoRange, RangeLoX, RangeLoY, RangeHiY, RangeHiY, FindMinMax, ZoomHistory

Class:	TRChart

Declaration:	procedure SetRange (xLo, yLo, xHi, yHi: double);

The method SetRange sets the extents of a chart at once and redraws it using the new scaling. The parameters xLo, yLo, xHi, and yHi specify the ranges of the x- and the y-axis. This method is of importance for cases where the range of a chart should be adjusted dynamically (e.g. following the movement of a mouse) because of avoiding any unnecessary calculation of the scales.

In case of invalid parameters (e.g. negative values with logarithmic scales) SetRange is not executed at all (no exception is generated). If any of the axes has no extent (i.e. xLo=xHi, or yLo=yHi), the range of the axis is automatically set to +/- 1 of the mid value.

Hint:	In order to set the ranges in a way that all graphics elements are visible, the method AutoRange can be used.


ShortTicksX property
 ShortTicksX

See also:	ShortTicksY, MinTickX

Class:	TRChart

Declaration:	property RcShortTicksX: boolean;

The property ShortTicksX determines whether the scale on the x-axis is subdivided by short unlabeled tick marks.


ShortTicksY property
 ShortTicksY

See also:	ShortTicksX, MinTickY

Class:	TRChart

Declaration:	property RcShortTicksY: boolean;

The property ShortTicksY determines whether the scale on the logarithmic y-axis is subdivided by short unlabeled tick marks. Please note that the property ShortTicksY has no effect for linear, or date/time scales.


 ShowNumLabel

See also: 	LabelFormatType, FrameStyleType

This method has been discarded with release 2.03 of RChart in order to give way to a better solution for displaying numeric labels. Numeric labels are now available in form of the visible component TNumLab.


 ShowGraf

See also:	ShowGrafNewOnly, AutoRedraw, ClearGraf, Using TRChart

Class:	TRChart

Declaration:	procedure ShowGraf;

The method ShowGraf brings the generated chart to the display. Note that in general, all the graphics elements of a chart are drawn in the off and copied to the visible screen by the method ShowGraf. This ensures that the flickering of the screen is effectively prevented during the drawing of an element. You should run the sample files RCH2WIN and RCHMOVEL in order to get a first impression.

Note:	The actual process executed by ShowGraf depends on the property AutoRedraw. If AutoRedraw is TRUE, then only the data area is reconstructed and displayed. Otherwise the whole chart window (including the axes) is constructed from scratch and displayed.


 ShowGrafNewOnly

See also:	ShowGraf, Using TRChart

Class:	TRChart

Declaration:	procedure ShowGrafNewOnly;

When adding a few drawing elements to an already heavily loaded chart, the update of the graphics takes considerable time. In order to speed up the update in this case the method ShowGrafNewOnly draws only those elements which have been entered into the linked list since the last call to ShowGraf.

Please note, that ShowGrafNewOnly only redraws the new elements, but not the axes or the grid. Thus ShowGrafNewOnly must not be called if the axes have been changed.


ShowHint (TRChart)
 ShowHint

See also:	Hint

Class:	TRChart

Declaration:	property ShowHint: boolean;

The ShowHint property determines if the control should display a help hint when the user's mouse pointer rests over the control. See the Delphi documentation for details.

Note, that the ShowHint property is not evaluated in the unregistered shareware version of TRChart. In this version ShowHint is internally set TRUE, and the Hint property is automatically set to the copyright message of the author. Anyway, you may set the ShowHint and Hint properties during the design process, but without having any effect on the run-time component. Of course, this special feature is omitted in the registered version, and ShowHint and Hint will function as documented in the Delphi manuals.


Tag (TRChart)
 Tag

See also:

Class:	TRChart

Declaration:	property Tag: longint;

The Tag property is available to store an arbitrary user-defined integer value. While the Tag property has no meaning to RChart, your application can use the property to store a value for its special needs.


TBakGndImg class
 TBakGndImg

See also:	BackGroundImg

The TBakGndImg class has been defined to provide a convenient access to the properties of the background image within the object inspector. TBakGndImg is not intended to be used by the user.


TBkgFill type
 TBkgFill

See also:	BackGroundImg, TTextBkg

Class:	TRChart

Declaration:	TBkgFill = (bfSimple, bfStretch, bfTile);

The type TBkgFill defines the fill mode of the background image:

bfSimple	take the backround image without altering its appearance

bfStretch	stretch the background image to fit the drawing area of RChart

bfTile	tile the drawing area with the background image


TDrawCan (TRChart)
 TDrawCan

See also:	GetItemParams, FirstItemOfLinkedList

Class:	TRChart

Declaration:	TDrawCan = record

Next	: PDrawCan;

x,y	: double;

color	: TColor;

tag	: longint;

lwid	: byte;

ItemClass	: byte;

case Element: ItemType of

    tkLine,

    tkRect : (x2,y2 : double;

           fillcol1 : TColor);

tkRectFrame: (x4,y4 : double;

           fillcol2 : TColor;

            framest : TRFrameStyle;

          shadowcol : TColor;

         hilightcol : TColor);

  tkEllipse: (ha,hv : double;

           fillcol3 : TColor);

  tk3DBar  : (x3,y3 : double;

           fillcol4 : TCOlor;

              depth : integer;

              angle : integer);

  tkText   : (txt   : string[15];

              size  : integer);

  tkMarkAt : (mark  : byte);

end;

This type declaration defines the basic element of the linked list which stores the graphics items. TDrawCan is normally not utilized by the user except for some special situations.

The variables declared in TDrawCan have the following meaning:

Next	Pointer to the next item of the linked list

x,y	Coordinates of the position of the item. If an item is defined by two points (like a line), x and y contain the first point (which is the reference point)

color	The color of the item (if applicable).

tag	A user defined data tag.

ItemClass	An arbitrary item class number which is used in some methods of TRChart.

Element	Indicator of the type of the item (see ItemType for details).

xi,yi	The second point of an item (in case of lines and rectangles).

fillcol	The filling color (if applicable)

framest	The style of the frame of a framed rectangle

shadowcol	The color of the shadow part of the frame

hilightcol	The color of the highlighted part of the frame

depth	The depth of a 3D bar

angle 	The angle of the 3D bar

mark	The number of the mark used (see MarkAt for details).

txt	A string of max. 15 characters for text items.

size	The size of the text.


TDTLabel class
 TDTLabel

See also:	DTXFormat, DTYFormat

The TDTLabel class has been defined to provide a convenient access to the time and date label properties within the object inspector. TDTLabel is not intended to be used by the user.


Text method
 Text

See also:	MarkAt, TextBkColor, TextBkStyle, TextFontStyle, TextAlignment

Class:	TRChart

Declaration:	procedure Text (x,y: RType; size: integer; txt: string);

The method Text is used to provide short labels for data points within a chart and displays the centered text  txt  at the position (x,y). Only the first 15 characters of the text are stored internally. The size of the font (in points) is determined by the parameter  size. The actual size of the font is adjusted to match the available font sizes (if not a TrueType font has been selected). The type of the font is determined by the Font property. The text is transparent and has the color of the property DataColor.

Hint 1:	You should not assign differen font types, font styles, or background colors to different text labels in the same chart, since this information is not stored and would not show up after a redraw of the chart.

Hint 2:	The method Text has primarily been designed to label some data by (short) alphanumeric labels. So do not use it to display any longer messages within the chart; such messages should not be put into a chart.


TextBkColor property
 TextBkColor

See also:	TextBkStyle, TextFontStyle, Text

Class:	TRChart

Declaration:	property TextBkColor: TColor;

The property TextBkColor determines the background color of a text label. Note that TextBkColor has no effect, if TextBkStyle is set to tbClear (which is the default case). TextBkColor is a global property for all text labels in a chart (method Text). Therefore it is not possible to have different background colors for text labels within the same chart.


 TextBkStyle

See also:	TTextBkg, TextBkColor, TextFontStyle, Text

Class:	TRChart

Declaration:	property TextBkStyle: TTextBkg;

The property TextBkStyle determines the style of the background of a text label. Two alternatives are available: tbClear and tbSolid.


TextFontStyle (TRChart)
 TextFontStyle

See also:	TextBkStyle, TextBkColor, Text

Class:	TRChart

Declaration:	property TextFontStyle: TFontStyles;

The property TextFontStyle determines the style of text labels (normal, italic, underlined, bold, and strike-out). The TextFontStyle property is a set, so it can contain multiple values.


TimeFormatType type
 TimeFormatType

See also:	DateOrderType, DTXFormat, DTYFormat

Class:	TRChart

Declaration:	TimeFormatType = (tfHHMMSS,tfHHhMM,tfAMPM);

The type declaration TimeFormatType defines the available formats for the time scale display. Below are a few examples of the available time formats:

tfHHMMSS	23:10:06	06:12:55

tfHHhMM	23h10	6h12:55

tfAMPM	11:10pm	6:12:55am

Note that the display of the seconds depends on the range of the axis. If the time resolution is too coarse, the seconds are supressed.


TRFrameStyle type
 TRFrameStyle

See also:	RectFrame

Class:	TRChart

Declaration:	TRFrameStyle = (rbLowered, rbRaised, rbEmbossed, rbEngraved);

The type declaration TRFrameStyle defines the style of the framed rectangle specified by the method RectFrame.


 TRChMouseLabel

See also:

This type declaration has been discarded with release 2.03 of RChart in order to give way to a better solution for displaying numeric labels. The event OnMouseMoveInChart can be used to display the current mouse position. Numeric labels are now available in form of the visible component TNumLab.


TMouseMoveInChartEvent type
 TMouseMoveInChartEvent

See also:	OnMouseMoveInChart, MousePosX, MousePosY

Class:	TRChart

Declaration:	TMouseMoveInChartEvent = procedure (Sender: TObject; InChart: boolean; Shift: TShiftState; rMousePosX, rMousePosY: double) of object;

The type declaration TMouseMoveInChartEvent defines the event which occurs when the mouse moves across the chart window. The parameter InChart is TRUE, if the mouse cursor is on the drawing area. The parameter Shift returns the state of the mouse buttons, and the parameters rMousePosX and rMousePosY return the mouse position in terms of the chart coordinates.

Note that InChart can be advantageously used to switch the state of the position display (for example gray out the position values, if the cursor is outside the drawing area).

The following example shows how to use the event in order to display the current mouse position. The components NumLab1 and NumLab2 are of the type TNumLab and can be switched off by setting the property Empty to TRUE.

procedure TForm1.RChart1MouseMoveInChart(Sender: TObject; InChart: Boolean; Shift: TShiftState; rMousePosX, rMousePosY: Double);

begin

NumLab1.Empty := not Inchart;

NumLab2.Empty := not Inchart;

NumLab1.Value := rMousePosX;

NumLab2.Value := rMousePosY;

end;

An example how to use the TMouseMoveInChartEvent can also be found in the sample program PRINTCHT.DPR which comes with the RChart package.


Top (TRChart)
 Top

See also:	Left

Class:	TRChart

Declaration:	property Top: Integer;

The property Top determines the y coordinate of the top left corner of RChart, relative to the form in pixels.


TRim property
 TRim

See also:	BRim, LRim, RRim, Height, Width

Class:	TRChart

Declaration:	property TRim: integer;

The property TRim specifies the distance between the top boundary of the chart window and the chart drawing area. The distance TRim is specified as the number of pixels between the two boundaries.


TTextBkg type
 TTextBkg

See also:	TextBkStyle, Text

Class:	TRChart

Declaration:	TTextBkg = (tbClear, tbSolid);

The type TTextBkg defines the type of background of a text label:

tbClear	transparent background

tbSolid	colored background; the background color is determined by the property TextBkColor.


TypeOfFirstItem (RChart)
 TypeOfFirstItem

See also:	TypeOfLastItem, RemoveFirstItem, FirstItemOfLinkedList

Class:	TRChart

Declaration:	property TypeOfFirstItem: ItemType;

The read-only property TypeOfFirstItem returns the type of the first item in the linked list.


TypeOfLastItem (RChart)
 TypeOfLastItem

See also:	TypeOfFirstItem, RemoveLastItem

Class:	TRChart

Declaration:	property TypeOfLastItem: ItemType;

The read-only property TypeOfLastItem returns the type of the last item in the linked list. This property can be used to remove certain types of graphics elements from the end of the linked list.

Example:	The following statement removes all elements from the end of the linked list which are not marks:

while (RChart1.TypeofLastItem <> tkMarkAt) and

      (RChart1.TypeofLastItem <> tkNone) do

  RChart1.RemoveLastItem;


Visible (TRChart)
 Visible

See also:	ClassVisible

Class:	TRChart

Declaration:	property Visible: boolean;

The property Visible controls the visibility of TRChart.


Width (RChart)
 Width

See also:	BRim, LRim, RRim, TRim, Height

Class:	TRChart

Declaration:	property Width: integer;

The property Width specifies the width of the chart window in pixels. RChart automatically restricts the minimum width of it to a value which provides at least a small region of the graphics area. The minimum width depends on the properties LRim and RRim.


WindColor property
 WindColor

See also:	ChartColor, DataColor, ScaleColor

Class:	TRChart

Declaration:	property WindColor: TColor;

The property WindColor determines the color of the chart window (the area outside the drawing are). Note, that the WindColor property is usually set to the color of the control where the chart is located.


 XLabelType

See also:	YLabelType

Class:	TRChart

Declaration:	property XLabelType: FigType;

The property XLabelType determines the type of the inscription of the x-axis. For a detailed description of the DateTime inscription see DTXFormat. User defined tick labels are described with the property UserTickTextX.


YearLengthType type
 YearLengthType

See also:	DTXFormat, DTYFormat

Class:	TRChart

Declaration:	YearLengthType = (ylNone, ylYY, ylYYYY);

The type declaration YearLengthType specifies the number of digits used for the display of the year on DateTime labelled axes:

ylNone	No year is displayed at all

ylYY	Only the last two places are displayed

ylYYYY	The full number of the year is shown


 YLabelType

See also:	XLabelType

Class:	TRChart

Declaration:	property YLabelType: FigType;

The property YLabelType determines the type of the inscription of the y-axis. For a detailed description of the DateTime inscription see DTYFormat. User defined tick labels are described with the property UserTickTextY.


 ZoomState

See also:	ZoomStateType, MouseActMode

Class:	TRChart

Declaration:	property  ZoomState: ZoomStateType;

The read only property ZoomState reflects the current zoom state of RChart. This property can be used to suppress certain actions during zooming (i.e. when performing a zoom by means of a window, which may be disturbed by actions such as redrawing, etc).


 ZoomStateType

See also:	ZoomState

Class:	TRChart

Declaration:	ZoomStateType = (zsNormal, zsDrawWin);

The type declaration ZoomStateType defines the possible states of zooming.


 TextAlignment

See also:	TextFontStyle, Text

Class:	TRChart

Declaration:	property TextAlignment: TAlignment;

The property TextAlignment determines the horizontal alignment of the text. TextAlignment may use the following values: taLeftJustify, taRightJustify, and taCenter. TextAlignment is a global property for all text labels in a chart (method Text). Therefore it is not possible to have different alignments for text labels within the same chart.


 OnZoomPan

See also:	TZoomPanEvent, other events

Class:	TRChart

Declaration:	OnZoomPan: TZoomPanEvent;

The event OnZoomPan occurs after viewport of RChart has been zoomed or panned. See TZoomPanEvent for a detailed description of the event.


 TZoomPanEvent

See also:	OnZoomPan, MouseAction

Class:	TRChart

Declaration:	TZoomPanEvent = procedure (Sender: TObject) of object;

The TZoomPanEvent is triggered by RChart whenever the boundaries of the chart are changed by a mouse action (the property MouseAction has therefore be set to a value other than maNone).

This event may be used to synchronize the viewports of several charts. Suppose you want to make sure that some chart "RChart2" always follows the range of the displayed area of another chart "RChart1". This can be easily achieved by setting the range of chart 2 when the OnZoomPan event is triggered:

procedure TForm1.RChart1ZoomPan(Sender: TObject);

begin

RChart2.SetRange (RChart1.RangeLoX, RChart1.RangeLoY,

                  RChart1.RangeHiX, RChart1.RangeHiY);

end;

Note: You should always use the method SetRange (instead of the properties RangeLoX..RangeHiY) for setting the displayed range of the chart, since setting the scale boundaries one after another would trigger automatic redraws and thus would slow down the display.


 RemoveItem

See also:	RemoveFirstItem, RemoveLastItem

Class:	TRChart

Declaration:	procedure RemoveItem (item: PDrawCan);

The method RemoveItem deletes the specified graphics element from the linked list. Note that you have to call the method ShowGraf in order to see any effect.


 ConfineZoomRange

See also:	MouseAction, SetRange, ZoomHistory

Class:	TRChart

Declaration:	procedure ConfineZoomRange (xLo, yLo, xHi, yHi: double);

The method ConfineRange defines a restriction for mouse controlled zooming and panning (see property MouseAction). Any zooming or panning is restricted to the area defined by the parameters xLo, yLo, xHi, and yHi .The restriction can be switched off by setting all four parameters to zero values.

Note that ConfineZoomRange only affects mouse conrolled zooming and panning (MouseAction <> maNone), but not any other way to change the visible area of the chart (i.e. SetRange, or AutoRange).


 TCrossHMode

See also:	CrossHairSetup

Class:	TRChart

Declaration:	TCrossHMode = (chOff, chHoriz, chVert, chBoth);

The type TCrossHMode declares the available kinds of cross hairs:

chOff	crosshair is switched off

chHoriz	only vertical information of crosshair position is displayed (as horizontal line across the chart)

chVert	only horizontal information of crosshair position is displayed (as vertical line across the chart)

chBoth	full crosshair is displayed


 PrintItHiRes

See also:	PrintIt, CopyToOpenPrinterHiRes

Class:	TRChart

Declaration:	procedure PrintItHiRes (ScaleF: double; BlkWhite: boolean);

The method PrintItHiRes provides a way to create a high resolution hardcopy on the currently selected printer. You may change the selected printer by assigning a proper value to the PrinterIndex property of the Printer object before calling PrintItHiRes. The parameter ScaleF determines the magnification factor of the printout. A factor of 1.0 creates an output which has roughly the size of the screen image (assuming a monitor resolution of 80 dots per inch). If the parameter BlkWhite is set to TRUE, the colors of the chart are suppressed and the chart is printed in black and white. This is normally the best way to proceed with B&W printers.

Important Hint:	There are a few restrictions concerning the printout created by PrintItHiRes. These restrictions are due to some bugs (or "features") in the Windows graphics library and in some printer drivers: (1) dashed lines (as in grid lines) are printed as solid lines; (2) light colors are not printed at all on some black and white printers; (3) flying shadows are not printed properly on some printers; (4) text items are not properly clipped at the chart borders on some printers.

Note, that PrintItHiRes prints only the chart and its contents but not any auxiliary elements such as the crosshairs, or the mouse cursor.

Hint:	In order to mix text and graphics, or to print several graphics on one page, the procedure CopyToOpenPrinterHiRes should be used.


 Registration of RChart

See also:	How to order

The component TRChart is a shareware component. You can register it for US$ 25,-. In return, you get the newest version of RChart and unlimited free updates by email. The registered version is, of course, fully functional and does no longer need the Delphi, or the C++Builder IDE. The user may then create stand-alone programs which can be deployed without paying any further licences.

Please note, that the sources of RChart are available separately at a price of US$ 150,-

 Click here for further details and infos on available discounts.


 Using RChart

See also:	Installation of RChart

The component TRChart is an easy to use scientific chart component which provides the most basic features to display charts within an arbitrary coordinate system. You can set up both the extents of the chart on the screen and the range of the real-valued data area in the chart. In order to get a first impression of TRChart try to run the sample programs.

Note:	The unregistered version is fully functional with two exceptions: (1) the Hint property is disabled; instead of a user-defined hint the copyright message of the author is displayed automatically. (2) The shareware version runs only when the Delphi IDE is also up and running.

TRChart provides the following chart elements which can be controlled by their corresponding properties and methods:

- the on-screen chart area

- the data window

- two labeled axes (x and y)

- a caption

- various kinds of grids

TRChart stores all the graphics elements drawn on it in a linked list. This ensures that these elements can be automatically redrawn if e.g. the coordinate system or the extents of the chart area are changed. Thus, do not draw on the chart area using methods other than the built-in methods of TRChart.

These are the elements (also called items in the program code) which are currently available in TRChart:

- point marks

- lines

- short texts (max. 15 characters)

- filled rectangles

- framed rectangles

- ellipses

- 3D bars

Each of these items has at least three implicite attributes which are either set by some methods of TRChart or are derived from some class properties at run-time; the common attributes are the position of an element (in the real coordinate system of the chart), its color, and the number of the class it belongs to. The class numbers are initially set to the ClassDefault and can be used to differentiate between different groups of drawing entries. Graphic elements of some classes may be selectively hidden by setting the array property ClassVisible accordingly. Class numbers can also be used to restrict some operations to certain items in the drawing.

TRChart provides an efficient and easy-to-handle algorithm for labelling the axes. The inscription of the axes is automatically generated in a way that the scale ticks always are placed on multiples of the numbers 1, 2, and 5. This avoids an effect oftenly seen in other packages which creates inscriptions like "-0.124  -0.001  0.122  0.245  0.368" instead of "-0.1  0.0  0.1  0.2  0.3". The user only has to specify the intended minimum number of scale ticks (properties MinTickX and MinTickY), and the bounds of the axes (RangeLoX, RangeLoY, RangeHiX, RangeHiY). As an alternative, the method AutoRange may be used to set the bounds of the chart axes such that all graphic elements are visible.

In addition, the user may also create axes based on a TDateTime (see Delphi reference) variable, showing time and date in various user-definable formats.

TRChart provides a simple but efficient means to suppress flickering when drawing new items (try the sample programs that come with TRChart). By default, drawing on a chart is done in the off; the results must be explicitely copied to the visible screen window by calling the method ShowGraf. Of course, there are a few exceptions to this general rule: the chart is automatically redrawn when you change any properties which effect the appearance of the drawing  (type of scaling, colors, grid, ...). In addition, the property AutoRedraw controls the automatic redrawing of the chart. If you add new data items without changing the set-up of the chart, you may use ShowGrafNewOnly instead of ShowGraf. This method updates only the new graphics elements and is thus much quicker than ShowGraf.

Basically, there are three ways to print the resulting charts: (1) You can use the method Print of the form where the chart is located. This is a quick and dirty method and produces a result which is usually not optimum. (2) The class TRChart provides a method PrintIt which has several advantages over the first approach: the output is scalable and can be forced to handle black and white printouts properly. (3) In order to mix hardcopies and text, or to place  hardcopies at some special position on the paper, the user may resort to the method CopyToOpenPrinter. This method is the most flexible way of printing. In addition to printing a chart, the user may also copy the chart into the clipboard or store it as a Windows BMP file.

TRChart also provides a mouse interface in order to display the current position of the mouse cursor (in real-world chart coordinates). The event OnMouseMoveInChart returns the mouse coordinates if the mouse moves within the chart area. It can be used to display the mouse position using any label or text component (the component TNumLab, which is available separately, is well suited to this task, since it provides a flickerfree update of the position).

Here is a sample framework for using TRChart:

1. set up the extents and the coordinate axes

2. initialize the drawing memory

3. draw the graph (in the off)

4. display the graph

In terms of Delphi source code this might look like this (note that the set-up of the ranges can also be performed within the object inspector):

  MyChart.RangeLoX := -1.2;                { range of chart area }

  MyChart.RangeHiX := 1.2;

  MyChart.RangeLoY := -1.5;

  MyChart.RangeHiY := 1.5;

  MyChart.ClearGraf;                          { initialize chart }

  MyChart.MoveTo (0,0);                { initial cursor position }

  for i:=1 to 200 do                 { draw the chart in the off }

    MyChart.DrawTo (sin(i/9),sin(i/7));

  MyChart.ShowGraf;                   { show the chart on screen }

If you prefer to use C++ (Borland C++Builder) the corresponding code might look like this:

  MyChart->RangeLoX = -1.2;                { range of chart area }

  MyChart->RangeHiX = 1.2;

  MyChart->RangeLoY = -1.5;

  MyChart->RangeHiY = 1.5;

  MyChart->ClearGraf();                       { initialize chart }

  MyChart->MoveTo (0,0);               { initial cursor position }

  for (i=1; i<=200; i++)             { draw the chart in the off }

    {

    MyChart->DrawTo (sin(i/9),sin(i/7));

    }

  MyChart->ShowGraf();                { show the chart on screen }


TNumLab

TNumLab has been designed to provide a flicker-free display of a numeric label, which is especially important in applications where some value has to be updated regularly (such as in process monitoring systems). TNumLab provides several numeric formats (two integer formats, several floating point formats and a hexadecimal format). The styles, colors, and dimensions can be set up arbitrarily.

TNumLab can be downloaded from the following URL: http://www.lohninger.com/


 Interface of RChart

Note: you may have to switch to small fonts to get a legible interface list.

uses

  SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,

  Forms, Dialogs, ExtCtrls, stdctrls, buttons, DsgnIntf, Menus;

const

  defLRim = 50;                    { default left rim in component CHART }

  defRRim = 10;                   { default right rim in component CHART }

  defTRim = 16;                     { default top rim in component CHART }

  defBRim = 32;                  { default bottom rim in component CHART }

  defShadowWidth = 0;                          { default width of shadow }

  defDataCol  = clblack;                            { default data color }

  defScaleCol = clBlack;                           { default scale color }

  defFillCol = clSilver;                            { default fill color }

  defChartCol = clWhite;                { default chart background color }

  defWindCol  = clBtnFace;             { default window background color }

  defGridCol  = clBlack;                            { default grid color }

  defLineWid  = 1;                                  { default line width }

  defRCHeight = 160;

  defRCWidth = 240;

  defBndLoX: double = 0.0;                 { default boundaries of scaled area }

  defBndLoY: double = 0.0;

  defBndHiX: double = 10.0;

  defBndHiY: double = 10.0;

  defDecPlcX = 1;                               { nr. of dec. places on x-axes }

  defDecPlcY = 1;                               { nr. of dec. places on y-axes }

  defNXTick = 3;                                   { number of ticks on x axis }

  defNYTick = 3;                                   { number of ticks on y axis }

  MaxRCMarks = 25;                          { number of available mark symbols }

  MinRCWidth = 50;                           { minimum width of RChart control }

  MinRCHeight = 10;                         { minimum height of RChart control }

  MaxTickPos = 50;                 { maximum number of synchronized grid lines }

  MaxZoomStack = 8;                                      { depth of zoom stack }

  RcMaxDouble  : extended = 1.7e308;

  MaxCrossH = 4;                                        { number of crosshairs }

type

  YearLengthType = (ylNone, ylYY, ylYYYY);

  DateOrderType = (doMMDDYY, doDDMMYY, doYYMMDD);

  TimeFormatType = (tfHHMMSS,tfHHhMM,tfAMPM);

  TCrossHMode = (chOff, chHoriz, chVert, chBoth);         { kind of cross hair }

  DateForTimeType = (dtNone, dtOnePerChart, dtOnePerDay, dtAllTicks);

  TBkgFill = (bfSimple, bfStretch, bfTile);

  TBakGndImg = class (TPersistent)                         { background bitmap }

               private

                 FName      : string;            { name of bitmap file to load }

                 FOnChange  : TNotifyEvent;

                 FIncldPath : boolean;            { if TRUE, include path info }

                 FFillMode  : TBkgFill;             { fill of background image }

                 procedure SetName (fn: string);

                 procedure SetIncldPath (x: boolean);

                 procedure SetFillMode (x: TBkgFill);

               protected

               public

                 constructor Create(AOwner: TComponent);

                 destructor Destroy; override;

                 procedure Changed;

                 property  OnChange: TNotifyEvent read FOnChange write FOnChange;

               published

                 property  Name: string read FName write SetName;

                 property  IncludePath: boolean read FIncldPath write SetIncldPath;

                 property  FillMode: TBkgFill read FFillMode write SetFillMode;

               end;

  TrcBakBMPEditor = class(TForm)

                      CBIncldPath: TCheckBox;

                      CBFillMode: TComboBox;

                      SBLoadBMP: TSpeedButton;

                      SBOK: TSpeedButton;

                      EdName: TEdit;

                      Label1: TLabel;

                      SBCancel: TSpeedButton;

                      Image1: TImage;

                      Bevel1: TBevel;

                      LblDims: TLabel;

                      procedure SBLoadBMPClick(Sender: TObject);

                      procedure CBIncldPathClick(Sender: TObject);

                      procedure SBOKClick(Sender: TObject);

                      procedure SBCancelClick(Sender: TObject);

                    private

                        { Private declarations }

                    public

                      FullName : string;

                    end;

  TBakGndFileProperty = class(TClassProperty)

                        public

                          procedure Edit; override;

                          function GetAttributes: TPropertyAttributes; override;

                        end;

  TDTLabel = class (TPersistent)               { parameters of DateTime labels }

             private

               FTimeFormat   : TimeFormatType;

               FDateSeparator: char;

               FTimeSeparator: char;

               FYearLength   : YearLengthType;

               FMonthName    : boolean;

               FDateOrder    : DateOrderType;

               FDateForTime  : DateForTimeType;

               FOnChange     : TNotifyEvent;

               procedure SetTimeFormat (Value: TimeFormatType);

               procedure SetDateForTime (value: DateForTimeType);

               procedure SetDateSeparator (Value: char);

               procedure SetTimeSeparator (Value: char);

               procedure SetYearLength (value: YearLengthType);

               procedure SetMonthName (value: boolean);

               procedure SetDAteOrder (value: DateOrderType);

             protected

             public

               procedure   Changed;

             published

               property TimeFormat: TimeFormatType read FTimeFormat write SetTimeFormat;

               property DateSeparator: char read FDateSeparator write SetDateSeparator;

               property TimeSeparator: char read FTimeSeparator write SetTimeSeparator;

               property YearLength: YearLengthType read FYearLength write SetYearLength;

               property MonthName: boolean read FMonthName write SetMonthName;

               property DateOrder: DateOrderType read FDateOrder write SetDateOrder;

               property DateForTime: DateForTimeType read FDateForTime write SetDateForTime;

               property OnChange: TNotifyEvent read FOnChange write FOnChange;

             end;

  TRFrameStyle = (rbLowered, rbRaised, rbEmbossed, rbEngraved);

  ItemType = (tkNone, tkMarkAt, tkLine, tkLineto, tkRect, tkRectFrame,

              tk3DBar, tkText, tkMoveTo, tkEllipse, tkEverything,

              tkNotMoveTo);

  PDrawCan = ^TDrawCan;

  TDrawCan = record

               Next       : PDrawCan;         { pointer to next Item }

               x,y        : double;            { coordinates of Item }

               color      : TColor;                  { color of Item }

               tag        : longint;              { user defined tag }

               lwid       : byte;                       { line width }

               ItemClass  : byte;             { class number of Item }

               case Element: ItemType of

                 tkLine,                                      { line }

                 tkRect   : (x2,y2 : double;             { rectangle }

                          fillcol1 : TColor);

               tkRectFrame: (x4,y4 : double;     { rectangular frame }

                          fillcol2 : TColor;

                           framest : TRFrameStyle;

                         shadowcol : TColor;

                        hilightcol : TColor);

                 tkEllipse: (ha,hv : double;               { ellipse }

                          fillcol3 : TColor);

                 tk3DBar  : (x3,y3 : double;                { 3D bar }

                          fillcol4 : TCOlor;

                             depth : integer;

                             angle : integer);

                 tkText   : (txt   : string[15];              { text }

                             size  : integer);

                 tkMarkAt : (mark  : byte);                   { mark }

             end;

  FigType = (ftNoFigs, ftNum, ftTime, ftNoScales, ftDateTime, ftUserText);

  GridStyleType = (gsNone, gsPoints, gsVertLines, gsHorizLines, gsLines,

                   gsHorizDotLines, gsVertDotLines, gsDotLines);

  TShadowStyle = (ssFlying, ssBox);

  TTextBkg = (tbClear, tbSolid);

  LabelStr = string[50];

  InscriptStr = string[15];

  ZoomStateType = (zsNormal, zsDrawWin);

  MouseBoxStateType = (msNormal, msFirstCorner, msRectDraw, msFinished);

  MouseActMode = (maNone, maPan, maZoomWind, maZoomWindPos, maZoomDrag);

                                        { event for mouse pos. in chart coords }

  TMouseMoveInChartEvent = procedure (Sender: TObject; InChart: boolean;

                                      Shift: TShiftState;

                                      rMousePosX, rMousePosY: double) of object;

                                        { event after zoom or pan }

  TZoomPanEvent = procedure (Sender: TObject) of object;

  TRChart = class(TGraphicControl)

            private

    {$IFDEF DEBUG}

              LastSystime     : double;

              SysTime         : array[1..300] of double;

              SystCnt         : longint;

    {$ENDIF}

              LButtonWasDown  : boolean;  { global identifier to track panning

                                                          by left mouse button }

              MouseAnchorScrX : integer; { anchor mouse pos. on TRChart canvas }

              MouseAnchorScrY : integer;

              MouseAnchorRcLoX: double;

              MouseAnchorRcLoY: double;

              MouseAnchorRcHiX: double;

              MouseAnchorRcHiY: double;

              FZoomState      : ZoomStateType;

              MouseBoxState   : MouseBoxStateType;

              LastMouseX      : integer;

              LastMouseY      : integer;

              MouseBoxX1      : integer;

              MouseBoxX2      : integer;

              MouseBoxY1      : integer;

              MouseBoxY2      : integer;

              WindAnchorX     : integer;

              WindAnchorY     : integer;

              WindOldCornerX  : integer;

              WindOldCornerY  : integer;

              FXTickPosCnt    : integer;              { tick positions - count }

              FYTickPosCnt    : integer;

              FXScaleTickPos  : array[1..MaxTickPos] of double; {tick positions}

              FYScaleTickPos  : array[1..MaxTickPos] of double;

              FItClassVisib   : array[0..255] of boolean; { visibility of item classes }

              FOnMMvInChart   : TMouseMoveInChartEvent;

              FOnZoomPan      : TZoomPanEvent;

              AuxBmp          : TBitMap;   { bitmap to hold background picture }

              AuxCHBmp        : TBitMap;        { bitmap to create cross hairs }

              GrafBmp         : TBitmap;          { off-screen graphics bitmap }

              ChartBmp        : TBitmap;             { off-screen chart bitmap }

              FBakGndFile     : TBakGndImg;                  { background file }

              FDataTag        : longint;                    { user defined tag }

              RcGridStyle     : GridStyleType;                 { style of grid }

              RcGridCol       : TColor;                        { color of grid }

              RcGridDx        : double;            { x-distance of grid points }

              RcGridDy        : double;            { y-distance of grid points }

              RcLRim          : integer;                            { left rim }

              RcRRim          : integer;                           { right rim }

              RcTRim          : integer;                             { top rim }

              RcBRim          : integer;                          { bottom rim }

              Rc3DRim         : integer;                     { width of shadow }

              RcShadowStyle   : TShadowStyle;                { style of shadow }

              RcShadowColor   : TColor;                      { color of shadow }

              RcShadowBakCol  : TColor;           { color of shadow background }

              RcShortTicksX   : boolean;   { display short ticks on abscissa ? }

              RcShortTicksY   : boolean;   { display short ticks on ordinate ? }

              RcXLog          : boolean;            { TRUE: logarithmic x-axis }

              RcYLog          : boolean;            { TRUE: logarithmic y-axis }

              RcMouseAction   : MouseActMode;   { type of allowed mouse action }

              RcFrstCan       : PDrawCan;         { buffer of drawing elements }

              RcLastCan       : PDrawCan;           { pointer to last drw. can }

              RcLastCanOnShow : PDrawCan; { pointer to last entry when ShowGraf is called }

              RcDataCol       : TColor;                        { color of data }

              RcScaleCol      : TColor;                      { color of scales }

              RcFillCol       : TColor;           { fill color of rect/ellipse }

              RcChartCol      : TColor;            { color of chart background }

              RcWindCol       : TColor;           { color of window background }

              RcLineWid       : byte;      { line width of tkLine and tkLineTo }

              TitStr          : string;                     { caption of chart }

              RcScaleInscrX   : InscriptStr;    { string for scale inscription }

              RcScaleInscrY   : InscriptStr;    { string for scale inscription }

              RcBndLoX        : double;            { boundaries of scaled area }

              RcBndLoY        : double;

              RcBndHiX        : double;

              RcBndHiY        : double;

              RcClassDefault  : byte;     { default class number for new items }

              RcDecPlcX       : integer;        { nr. of dec. places on x-axes }

              RcDecPlcY       : integer;        { nr. of dec. places on y-axes }

              Cpkx, Cpdx      : double;         { params for scaling on x-axis }

              Cpky, Cpdy      : double;         { params for scaling on y-axis }

              RcXUnits        : LabelStr;          { unit identif. on abscissa }

              RcYUnits        : LabelStr;          { unit identif. on ordinate }

              RcXNtick        : integer;           { number of ticks on x-axis }

              RcYNtick        : integer;           { number of ticks on x-axis }

              RcXLabelType    : FigType;                    { type of labeling }

              RcYLabelType    : FigType;                    { type of labeling }

              FUserTickTextX  : String;      { user defined labeling of x axis }

              FUserTickTextY  : String;      { user defined labeling of y axis }

              FMousePosX      : double;       { mouse x position - real coords }

              FMousePosY      : double;       { mouse y position - real coords }

              FDTXFormat      : TDTLabel;         { format of date/time labels }

              FDTYFormat      : TDTLabel;

              FMCurFixed      : boolean;            { TRUE: fixed mouse cursor }

              FCrossHPos      : array[1..MaxCrossH,1..2] of double; { crosshair positions }

              FCrossHColor    : array[1..MaxCrossH] of TColor;  { color of crosshair }

              FCrossHMode     : array[1..MaxCrossH] of TCrossHMode;  { mode of crosshair }

              FCrossHLineType : array[1..MaxCrossH] of TPenStyle; { type of crosshair line }

              FCrossHLineWid  : array[1..MaxCrossH] of integer; { width of crosshair line }

              FAutoRedraw     : boolean; {TRUE: automatic redraw on any change }

              FNumPPa         : longint;         { number of polyline segments }

              FTextFontStyle  : TFontStyles;       { font style of text labels }

              FTextBkStyle    : TTextBkg;    { background style of text labels }

              FTextBkColor    : TColor;      { background color of text labels }

              FTextAlignment  : TAlignment;                { aligmnent of text }

              FIsometric      : boolean;          { TRUE: scales are isometric }

              FZoomStack      : array[1..MaxZoomStack,1..4] of double; { circ. zoom stack }

              FZStackPoi      : integer;                  { zoom stack pointer }

              FZoomRange      : array[1..4] of double;   { confined zoom range }

              procedure AdjustScaling; virtual;

              function  AddScaleInscription (Instring: string; Inscr: InscriptStr): string;

              procedure ConstructChartBmp(cv: TCanvas);

              procedure ConstructDataBmp (cv: TCanvas; PosX, PosY: integer; BlkWhite: boolean;

                                          FirstItem: PDrawCan);

              procedure DrawCrossHairs (xPos, yPos: integer; SrcBmp: TBitMap);

              function  ExtractUserText (TickText: string; ix: integer): string;

              procedure ForceRange (xLo, yLo, xHi, yHi: double; EnterToZoomStack: boolean;

                                    ConfineRange: boolean);

              function  GetTypeOfFirstItem: ItemType;

              function  GetTypeOfLastItem: ItemType;

              function  GetFirstItemLL: PDrawCan;

              function  GetClassVisib (cnum: byte): boolean;

              function  GetCHPosX (chnum: integer): double;

              function  GetCHPosY (chnum: integer): double;

              procedure InitGraf (cv: TCanvas; PosX, PosY: integer);

              procedure SetClassVisib (cnum: byte; value: boolean);

              procedure SetCHPosX (chnum: integer; value: double);

              procedure SetCHPosY (chnum: integer; value: double);

              procedure SetLRim (r: integer);

              procedure SetRRim (r: integer);

              procedure SetTRim (r: INTEGER);

              procedure SetBRim (r: integer);

              procedure SetRc3DRim (r: integer);

              procedure SetDataTag (tag: longint);

              procedure SetShadowStyle (ss: TShadowStyle);

              procedure SetShadowColor (c: TColor);

              procedure SetShadowBakColor (c: TColor);

              procedure SetClassDefault (DefClass: byte);

              procedure SetDecPlcX (d: integer);

              procedure SetDecPlcY (d: integer);

              procedure SetGridStyle (gs: GridStyleType);

              procedure SetGridDx (dx: double);

              procedure SetGridDy (dy: double);

              procedure SetDataCol (c: TColor);

              procedure SetScaleCol (c: TColor);

              procedure SetFillCol (c: TColor);

              procedure SetChartCol (c: TColor);

              procedure SetWindCol (c: TColor);

              procedure SetGridCol (c: TColor);

              procedure SetTitStr (hstr: string);

              procedure SetLineWid (w: byte);

              procedure SetXUnits (hstr: LabelStr);

              procedure SetYUnits (hstr: LabelStr);

              procedure SetShortTicksX (st: boolean);

              procedure SetShortTicksY (st: boolean);

              procedure SetRcXLog (XLog: boolean);

              procedure SetRcYLog (YLog: boolean);

              procedure SetBndLoX (r: double);

              procedure SetBndHiX (r: double);

              procedure SetBndLoY (r: double);

              procedure SetBndHiY (r: double);

              procedure SetDTXFormat (x: TDTLabel);

              procedure SetDTYFormat (x: TDTLabel);

              procedure WMMouseMoveInChart(var Message: TWMMouse); message WM_MOUSEMOVE;

              procedure SetXNTick (d: integer);

              procedure SetYNTick (d: integer);

              procedure SetTextFontStyle (tfs: TFontStyles);

              procedure SetTextBkStyle (bs: TTextBkg);

              procedure SetTextBkColor (bc: TColor);

              procedure SetTextAlignment (al: TAlignment);

              procedure SetXLabType (x: FigType);

              procedure SetYLabType (x: FigType);

              procedure SetUserTickTextX (txt : String);

              procedure SetUserTickTextY (txt : String);

              procedure SetScaleInscrX (x: InscriptStr);

              procedure SetScaleInscrY (x: InscriptStr);

              procedure SetBakGndFile (x: TBakGndImg);

              procedure ZoomStateOnStack;

              procedure ShowYaxInternal (cv: TCanvas; XPos: integer; LowRange, HighRange: double;

                          NTicks, DecPlaces: integer; LabelType: FigType; LogAx: boolean;

                          ScaleInscript: InscriptStr; UserTicktext: string;

                          UnitLabel: LabelStr; StoreTickPos: boolean);

            protected

              procedure Paint; override;

              procedure MouseMove (Shift: TShiftState; X,Y: integer); override;

              procedure MouseMoveInChart (InChart: boolean; Shift: TShiftState;

                                          RMousePosX, RMousePosY: double);

              procedure MouseDown (Button: TMouseButton;

                                   Shift: TShiftState; X, Y: Integer); override;

              procedure MouseUp (Button: TMouseButton;

                                 Shift: TShiftState; X, Y: Integer); override;

              procedure StyleChanged (Sender: TObject);

              procedure DoZoomPanEvent;

            public

              constructor Create(AOwner: TComponent); override;

              destructor Destroy; override;

              procedure M2R (xin,yin: longint; var xout,yout: double);

              procedure R2M (xin,yin: double; var xout,yout: longint);

              procedure ClearGraf;

              procedure ConfineZoomRange (xLo, yLo, xHi, yHi: double);

              procedure ShowGraf;

              procedure ShowGrafNewOnly;

              procedure SetBounds (ALeft, ATop, AWidth, AHeight: Integer); override;

              function  MouseBox (var xLo, yLo, xHi, yHi: double): boolean;

                                                           { draw }

              procedure Bar3D (llx, lly, urx, ury: double;

                               Depth: integer; Angle: integer);

              procedure CopyToBMP (FName: string);

              procedure CopyToClipboard;

              procedure CopyToOpenPrinter (var x,y: integer; ScaleF: double; BlkWhite: boolean);

              procedure CopyToOpenPrinterHiRes (var x,y: integer; ScaleF: double; BlkWhite: boolean);

              property  CrossHairPosX [chnum: integer]: double read GetCHPosX write SetCHPosX;

              property  CrossHairPosY [chnum: integer]: double read GetCHPosY write SetCHPosY;

              procedure CrossHairSetPos (chnum: integer; x,y: double);

              procedure CrossHairSetup (ch: integer; chColor: TColor; Mode: TCrossHMode;

                                  LineType: TPenStyle; LineWidth: integer);

              property  DataTag: longint read FDataTag write SetDataTag;

              procedure DrawTo (x,y: double);

              procedure Ellipse (cx, cy, HorizAxLeng, VertAxLeng: double);

              procedure Line (x1,y1, x2, y2: double);

              procedure MoveTo (x,y: double);

              procedure MarkAt (x,y: double; mk: byte);

              procedure PrintIt (ScaleF: double; BlkWhite: boolean);

              procedure PrintItHiRes (ScaleF: double; BlkWhite: boolean);

              procedure Rectangle (x1,y1, x2, y2: double);

              procedure RectFrame (x1,y1, x2, y2: double; FrameStyle: TRFrameStyle;

                                   ShadowColor, HiLightColor: TColor);

              procedure SaveLinkedListASC (FName: string);

              procedure SaveLinkedList (FName: string);

              procedure LoadLinkedList (FName: string; AppendIt: boolean);

              procedure SetRange (xLo, yLo, xHi, yHi: double);

              procedure AutoRange (rim: double);

              procedure Text (x,y: double; size: integer; txt: string);

                                                           { process single item }

              procedure RemoveLastItem;

              procedure RemoveFirstItem;

              procedure RemoveItem (Item: PDrawCan);

              procedure FindMinMax (RangeLoX, RangeLoY, RangeHiX, RangeHiY: double;

                                    var MinX, MinY, MaxX, MaxY: double);

              function  FindNearestItemReal (mx, my: double; ItemID: ItemType;

                                             ClassNumber: byte; var Dist: double): PDrawCan;

              function  FindNearestItemScreen (mx, my: double; ItemID: ItemType;

                                              ClassNumber: byte; var Dist: double): PDrawCan;

              property  FirstItemOfLinkedList: PDrawCan read GetFirstItemLL;

              function  GetItemParams (Item: PDrawCan): TDrawCan;

              procedure SetItemParams (Item: PDrawCan; ItParams: TDrawCan);

              procedure ScaleItem (Item: PDrawCan; kx, dx, ky, dy: double);

                                                           { process more items }

              function  MarkItemsInWindow (xLo, YLo, XHi, YHi: double; ItemID: ItemType; ClassNumber: byte): longint;

              procedure MarkAllItems (ItemID: ItemType; ClassNumber: byte);

              property  ClassVisible [cnum:byte]: boolean read GetClassVisib write SetClassVisib;

              procedure ScaleAllItems (kx, dx, ky, dy: double);

              procedure ScaleSelectedItems (kx, dx, ky, dy: double; ClassNumber: byte);

              property  TypeOfLastItem: ItemType read GetTypeOfLastItem;

              property  TypeOfFirstItem: ItemType read GetTypeOfFirstItem;

              procedure NewColorOfClassItems (Newcol: TColor; ClassNumber: byte);

              property  ZoomState: ZoomStateType read FZoomState;

              procedure ZoomHistory (Index: integer);

            published

              property Font;

              property Align;

              property Visible;

              property ShowHint;

              property PopupMenu;

              property AutoRedraw: boolean read FAutoRedraw write FAutoRedraw;

              property LRim: integer read RcLrim write SetLRim default DefLRim;  { left rim of graphics }

              property RRim: integer read RcRRim write SetRRim default DefRRim;  { right rim of graphics }

              property TRim: integer read RcTRim write SetTRim default DefTRim;  { top rim of graphics }

              property BRim: integer read RcBRim write SetBRim default DefBRim;  { bottom rim of graphics }

              property BackGroundImg: TBakGndImg read FBakGndFile write SetBakGndFile;

              property ClassDefault: byte read RcClassDefault write SetClassDefault;

              property DecPlaceX: integer read RcDecPlcX write SetDecPlcX default defDecPlcX;

              property DecPlaceY: integer read RcDecPlcY write SetDecPlcY default defDecPlcY;

              property GridStyle: GridStyleType read RcGridStyle write SetGridStyle;     { style of grid }

              property GridDx: double read RcGridDx write SetGridDx;         { x-distance of grid points }

              property GridDy: double read RcGridDy write SetGridDy;         { y-distance of grid points }

              property RangeLoX: double read RcBndLoX write SetBndLoX;  { left boundary of scaled area }

              property RangeHiX: double read RcBndHiX write SetBndHiX;  { right boundary of scaled area }

              property RangeLoY: double read RcBndLoY write SetBndLoY;  { lower boundary of scaled area }

              property RangeHiY: double read RcBndHiY write SetBndHiY;  { upper boundary of scaled area }

              property DataColor: TColor read RcDataCol write SetDataCol default DefDataCol;

              property ScaleColor: TColor read RcScaleCol write SetScaleCol default DefScaleCol;

              property FillColor: TColor read RcFillCol write SetFillCol default DefFillCol;

              property ChartColor: TColor read RcChartCol write SetChartCol default DefChartCol;

              property WindColor: TColor read RcWindCol write SetWindCol default DefWindCol;

              property GridColor: TColor read RcGridCol write SetGridCol default DefGridCol;

              property LineWidth: byte read RcLineWid write SetLineWid default DefLineWid;

              property Caption: string read TitStr write SetTitStr;

              property IdAbscissa: LabelStr read RcXUnits write SetXUnits;

              property IdOrdinate: LabelStr read RcYUnits write SetYUnits;

              property ScaleInscriptX: InscriptStr read RcScaleInscrX write SetScaleInscrX;

              property ScaleInscriptY: InscriptStr read RcScaleInscrY write SetScaleInscrY;

              property LogScaleX: boolean read RcXLog write SetRcXLog;

              property LogScaleY: boolean read RcYLog write SetRcYLog;

              property MinTickX: integer read RcXNTick write SetXNTick default defNXTick;

              property MinTickY: integer read RcYNTick write SetYNTick default defNYTick;

              property MousePosX: double read FMousePosX;

              property MousePosY: double read FMousePosY;

              property MouseAction: MouseActMode read RcMouseAction write RcMouseAction;

              property MouseCursorFixed: boolean read FMCurFixed write FMCurFixed;

              property ShadowWidth: integer read Rc3DRim write SetRc3DRim default DefShadowWidth;

              property ShadowStyle: TShadowStyle read RcShadowStyle write SetShadowStyle;

              property ShadowColor: TColor read RcShadowColor write SetShadowColor;

              property ShadowBakColor: TColor read RcShadowBakCol write SetShadowBakColor;

              property ShortTicksX: boolean read RcShortTicksX write SetShortTicksX;

              property ShortTicksY: boolean read RcShortTicksY write SetShortTicksY;

              property TextFontStyle: TFontStyles read FTextFontStyle write SetTextFontStyle;

              property TextBkStyle: TTextBkg read FTextBkStyle write SetTextBkStyle;

              property TextBkColor: TColor read FTextBkColor write SetTextBkColor;

              property TextAlignment: TAlignment read FTextAlignment write SetTextAlignment;

              property XLabelType: FigType read RcXLabelType write SetXLabType;

              property YLabelType: FigType read RcYLabelType write SetYLabType;

              property UserTickTextX: String read FUserTickTextX write SetUserTickTextX;

              property UserTickTextY: String read FUserTickTextY write SetUserTickTextY;

              property DTXFormat: TDTLabel read FDTXFormat write SetDTXFormat;

              property DTYFormat: TDTLabel read FDTYFormat write SetDTYFormat;

              property OnClick;

              property OnDblClick;

              property OnMouseMove;

              property OnMouseDown;

              property OnMouseUp;

              property OnMouseMoveInChart: TMouseMoveInChartEvent read FOnMMvInChart write FOnMMvInChart;

              property OnZoomPan: TZoomPanEvent read FOnZoomPan write FOnZoomPan;

            end;

var

  rcBakBMPEditor: TrcBakBMPEditor;

procedure Register;


How to get most speed out of RChart

general: use speed-optimized graphics drivers of the manufacturer of your graphics card

specific:

Do not mix colors: draw all items of one color, then the next color, and so on.

Use DrawTo (instead of Line) for multi-segment lines

Set the property AutoRedraw to FALSE

Use ShowGrafNewOnly


 Installation of RChart

See also:	Using RChart, Delphi and C++Builder Issues

The installation of the component is a two-part process. First you have to install the component into the Delphi (C++ Builder) VCL by following the instructions in the Delphi (C++Builder) manual.  Secondly, you should install the help file of this component into the help system of Delphi (C++ Builder).

Delphi installation

C++ Builder installation


ZoomHistory

See also:	MouseAction, MaxZoomStack, SetRange

Class:	TRChart

Declaration:	procedure ZoomHistory (Index: integer);

The method ZoomHistory allows to revert to a previous zoom state of the chart. Any changes of the chart ranges (either due to mouse actions or to programmatical changes) are recorded and stored in a circular stack of 8 (MaxZoomStack) elements. Therefore, the last 8 different setups are available by accessing this stack using the method ZoomHistory. The parameter Index may take any value between -7 and 0, referring to the oldest setup (Index = -7) up to the most recent one (Index = 0).

Note that setting the chart ranges by means of ZoomHistory does not (re)enter these settings into the zoom stack.


UserTickTextX

See also:	ScaleInscriptX, UserTickTextY

Class:	TRChart

Declaration:	property UserTickTextX: string;

The property UserTickTextX specifies the user defined tick labels which are displayed if the property XLabelType is set to ftUserText. The tick labels are stored in the property UserTickTextX as a single string. The individual tick labels are separated by the pipe symbol '|'. Note that the last label is repeated on the displayed x axis if there are more (major) tick marks than labels. In order to prevent the repetition of the last label you have to add a terminating | symbol to the UserTickTextX property.

Hint:	User defined tick labels do not make sense if you allow the chart being panned or zoomed.

Remark:	The user defined tick labels of the axes (introduced with version 4.00 of RChart) go back to an implementation of Benedikt Magrean (Magrean@IBAC.rwth-aachen.de) and Michael Jägers from IBAC, RWTH-Aachen, Germany, who kindly provided their sources. After checking their approach, I decided to go a slightly different way, which is more consistent with the overall design of RChart. Thanks to Ben and Michael for their support.


UserTickTextY

See also:	ScaleInscriptY, UserTickTextX

Class:	TRChart

Declaration:	property UserTickTextY: string;

The property UserTickTextY specifies the user defined tick labels which are displayed if the property YLabelType is set to ftUserText. The tick labels are stored in the property UserTickTextY as a single string. The individual tick labels are separated by the pipe symbol '|'. Note that the last label is repeated on the displayed y axis if there are more (major) tick marks than labels. In order to prevent the repetition of the last label you have to add a terminating | symbol to the UserTickTextY property.

Hint:	User defined tick labels do not make sense if you allow the chart being panned or zoomed.

Remark:	The user defined tick labels of the axes (introduced with version 4.00 of RChart) go back to an implementation of Benedikt Magrean (Magrean@IBAC.rwth-aachen.de) and Michael Jägers from IBAC, RWTH-Aachen, Germany, who kindly provided their sources. After checking their approach, I decided to go a slightly different way, which is more consistent with the overall design of RChart. Thanks to Ben and Michael for their support.


MathFeedBackProc [Math1]
 MathFeedBackProc

This routine is part of the unit MATH1

For technical reasons the help file for unit MATH1 is a separate file. You may obtain further information either by using the help file MATH1.HLP, or by using the SDL component suite help SDLSUITE.HLP. Both files can be downloaded from our webserver http://www.lohninger.com/


MouseAction [RChart]
 MouseAction

This routine is part of the unit RCHART

For technical reasons the help file for unit RCHART is a separate file. You may obtain further information either by using the help file RCHART.HLP, or by using the SDL component suite help SDLSUITE.HLP. Both files can be downloaded from our webserver http://www.lohninger.com/


ProcStat [Math1]
 ProcStat

This routine is part of the unit MATH1

For technical reasons the help file for unit MATH1 is a separate file. You may obtain further information either by using the help file MATH1.HLP, or by using the SDL component suite help SDLSUITE.HLP. Both files can be downloaded from our webserver http://www.lohninger.com/


Installation [RChart]
 Installation of RChart

This routine is part of the unit RCHART

For technical reasons the help file for unit RCHART is a separate file. You may obtain further information either by using the help file RCHART.HLP, or by using the SDL component suite help SDLSUITE.HLP. Both files can be downloaded from our webserver http://www.lohninger.com/


SetRange [RChart]
 SetRange

This routine is part of the unit RCHART

For technical reasons the help file for unit RCHART is a separate file. You may obtain further information either by using the help file RCHART.HLP, or by using the SDL component suite help SDLSUITE.HLP. Both files can be downloaded from our webserver http://www.lohninger.com/


ShowGraf [RChart]
 ShowGraf

This routine is part of the unit RCHART

For technical reasons the help file for unit RCHART is a separate file. You may obtain further information either by using the help file RCHART.HLP, or by using the SDL component suite help SDLSUITE.HLP. Both files can be downloaded from our webserver http://www.lohninger.com/


AutoRedraw [RChart]
 AutoRedraw

This routine is part of the unit RCHART

For technical reasons the help file for unit RCHART is a separate file. You may obtain further information either by using the help file RCHART.HLP, or by using the SDL component suite help SDLSUITE.HLP. Both files can be downloaded from our webserver http://www.lohninger.com/


CalcPrincComp [Math2]
 CalcPrincComp

This routine is part of the unit MATH2

For technical reasons the help file for unit MATH2 is a separate file. You may obtain further information either by using the help file MATH2.HLP, or by using the SDL component suite help SDLSUITE.HLP. Both files can be downloaded from our webserver http://www.lohninger.com/


Create [Matrix]
 Create

This routine is part of the unit MATRIX

For technical reasons the help file for unit MATH2 is a separate file. You may obtain further information either by using the help file MATH2.HLP, or by using the SDL component suite help SDLSUITE.HLP. Both files can be downloaded from our webserver http://www.lohninger.com/


TDistMode [Matrix]
 TDistMode

This routine is part of the unit MATRIX

For technical reasons the help file for unit MATRIX is a separate file. You may obtain further information either by using the help file MATRIX.HLP, or by using the SDL component suite help SDLSUITE.HLP. Both files can be downloaded from our webserver http://www.lohninger.com/

----------

Declaration:	TDistMode = (dmJaccard, dmManhattan, dmEuclid, dmEuclidSqr);

The type declaration TDistMode defines the possible operating modes of the method CalcDistMat. Currently the following distances can be calculated:

dmJaccard	similarity measure first defined by P. Jaccard (sometimes also referred to as Tanimoto coefficient)

dmManhattan	Manhattan or city block distance

dmEuclid	Euclidean distance

dmEuclidSqr	squared Euclidean distance


Unit Plot3D
Plot3D

The unit Plot3D contains a Delphi / C++ Builder visual component which supports the display of three dimensioal surfaces. The surfaces are defined by a rectangular grid of height values, and can be viewed from any angle and in any direction. numeric labels. The component TPlot3D comes together with this help file and a sample program (both Pascal and C++).

For technical reasons, this help file is restricted to a single component or unit. If you want to have the cumulative help for all components available from SDL, you may download a free copy of the cumulative help from our web site:

http://www.lohninger.com/


Unit Kohonen
Kohonen

The unit KOHONEN provides a selforganizing map (SOM) as it has been described by Teuvo Kohonen. These SOMs are also known as Kohonen maps, or Kohonen neural networks. The unit KOHONEN contains the class TKohonen which simulates a Kohonen neural network.

For technical reasons, this help file is restricted to a single component or unit. If you want to have the cumulative help for all components available from SDL, you may download a free copy of the cumulative help from our web site:

http://www.lohninger.com/


Unit Statis
Statis

The unit STATIS offers some of the most fundamental procedures of mathematical statistics. Along with the Gamma and the Beta function, all major types of distributions are implemented (normal, t, F, and chi-square distribution). A major benefit of this package is that the distribution functions are calculated analytically and not by approximations, or by table lookup. Thus the precision is at least eight digits.

For technical reasons, this help file is restricted to a single component or unit. If you want to have the cumulative help for all components available from SDL, you may download a free copy of the cumulative help from our web site:

http://www.lohninger.com/


Unit Meter
Meter

The unit Meter contains a Delphi visual component which supports the display of analog meters (the good old index instruments). The component is named TMeter and comes together with this help file and a sample application.

For technical reasons, this help file is restricted to a single component or unit. If you want to have the cumulative help for all components available from SDL, you may download a free copy of the cumulative help from our web site:

http://www.lohninger.com/


Unit DirTree
DirTree

This component provides a directory tree similar to the one provided by Borland with their sample component TDirectoryOutline. Horwever, TDirTree is much more carefully designed, has less bugs and is much faster. Currently, TDirTree is limited to a maximum of 1900 directories per drive.

For technical reasons, this help file is restricted to a single component or unit. If you want to have the cumulative help for all components available from SDL, you may download a free copy of the cumulative help from our web site:

http://www.lohninger.com/


Unit ColSel
ColSel

The unit ColSel contains a Delphi visual component which supports the display of the predefined system colors in a combo box.

For technical reasons, this help file is restricted to a single component or unit. If you want to have the cumulative help for all components available from SDL, you may download a free copy of the cumulative help from our web site:

http://www.lohninger.com/


Unit Rot3D
Rot3D

The unit ROT3D displays three-dimensional data and supports flickerfree rotation of the 3D view. The rotation can be achieved either by mouse interaction, or by using built-in methods of the class TRot3D. The data can be viewed from any direction, and can be zoomed and panned. Optionally, axes and/or a bounding box may be displayed.

For technical reasons, this help file is restricted to a single component or unit. If you want to have the cumulative help for all components available from SDL, you may download a free copy of the cumulative help from our web site:

http://www.lohninger.com/


Unit NumLab
NumLab

The unit NumLab contains a Delphi / C++ Builder visual component which supports the display of numeric labels. The component TNumLab comes together with this help file and a sample program (both Pascal and C++).

For technical reasons, this help file is restricted to a single component or unit. If you want to have the cumulative help for all components available from SDL, you may download a free copy of the cumulative help from our web site:

http://www.lohninger.com/


Unit NumIO
NumIO

The unit NumLab contains a Delphi / C++ Builder visual component which supports the input of numeric data in various formats. The component TNumIO comes together with this help file and a sample program (both Pascal and C++).

For technical reasons, this help file is restricted to a single component or unit. If you want to have the cumulative help for all components available from SDL, you may download a free copy of the cumulative help from our web site:

http://www.lohninger.com/


Unit CForm
CForm

The unit CForm contains a class (TMolForm) which supports the handling and display of molecular formulas.  Apart from displaying chemical formulas using the usual notation (subscripted number of atoms, superscripted isotopic labels), CForm also provides several methods supporting some calculations around chemical formulas:

calculating the molecular weight

comparison of formulas

finding formulas for a given molecular weight

scanning strings for molecular formulas

For technical reasons, this help file is restricted to a single component or unit. If you want to have the cumulative help for all components available from SDL, you may download a free copy of the cumulative help from our web site:

http://www.lohninger.com/


Unit DStruct
DStruct

The unit DStruct contains routines, which support the implementation of commonly used data structures (FIFO registers, and bit fields).

For technical reasons, this help file is restricted to a single component or unit. If you want to have the cumulative help for all components available from SDL, you may download a free copy of the cumulative help from our web site:

http://www.lohninger.com/


Unit Vector
Vector

The unit Vector offers some of the more important operations for processing floating point vectors. It hides all stuff dealing with array addressing and memory management. Thus, the user may fully concentrate on his/her work with vectors.

For technical reasons, this help file is restricted to a single component or unit. If you want to have the cumulative help for all components available from SDL, you may download a free copy of the cumulative help from our web site:

http://www.lohninger.com/


Unit Math1
Math1

The unit MATH1 offers several fundamental arithmetic operators and mathematical/logical routines which have not been implemented in Delphi (e.g. hyperbolic functions, tangens, cotangens, or common logarithm). The unit also contains routines to sort data, to produce different numeric formats, to generate random numbers of special distributions, etc. In addition, a special version of the Delphi str procedure is offered which is declared as a function returning the formatted string. This considerably eases the display of numeric values.

For technical reasons, this help file is restricted to a single component or unit. If you want to have the cumulative help for all components available from SDL, you may download a free copy of the cumulative help from our web site:

http://www.lohninger.com/


Unit StringL
StringL

The unit StringL offers some means to process strings. A collection of procedures and functions provide several often used string formatting functions. In addition, StringL contains the class TGrep which offers a versatile string search utility using the wide spread definition of regular expressions as e.g. in the Unix command "grep".

For technical reasons, this help file is restricted to a single component or unit. If you want to have the cumulative help for all components available from SDL, you may download a free copy of the cumulative help from our web site:

http://www.lohninger.com/


Unit CData
CData

The unit CDATA consists of some important chemical data tables and conversion routines as well as some basic routines processing chemical information. Among these are the conversion of atom symbols to atomic numbers, the chemical atomic weight of all chemical elements, the atom symbols of all elements, the atomic weight of the most abundant isotope of each chemical element, the support of a graphical display of a periodic table of the elements, several important chemical constants, the calculation of the molecular weight, the checking for a correct CAS registry number, and the number of valence electrons.

For technical reasons, this help file is restricted to a single component or unit. If you want to have the cumulative help for all components available from SDL, you may download a free copy of the cumulative help from our web site:

http://www.lohninger.com/


Unit Fourier
Fourier

The unit FOURIER contains a visual component for FFT (Fast Fourier Transform).

For technical reasons, this help file is restricted to a single component or unit. If you want to have the cumulative help for all components available from SDL, you may download a free copy of the cumulative help from our web site:

http://www.lohninger.com/


Unit Indexer
Indexer

The unit Indexer contains a text indexing machine. The indexes may be created either by use of a thesaurus, or a list of masked keywords, or by indexing every word which is not contained in a list of stop words. Indexer supports the use of regular expressions.

For technical reasons, this help file is restricted to a single component or unit. If you want to have the cumulative help for all components available from SDL, you may download a free copy of the cumulative help from our web site:

http://www.lohninger.com/


Unit Math2
Math2

The unit MATH2 offers some of the most fundamental procedures of univariate statistics (such as mean values, standard deviations, or the correlation coefficient for a series of data pairs). In addition, several more advanced mathematical methods (such as the calculation of eigenvectors and principal components, a simple clustering algorithm, and the approximation of the normal and the t-distribution) are contained in this unit. The unit MATH2 also contains a simple, yet powerful class (TCurveFit) which supports curve fitting of bivariate data.

For technical reasons, this help file is restricted to a single component or unit. If you want to have the cumulative help for all components available from SDL, you may download a free copy of the cumulative help from our web site:

http://www.lohninger.com/


Unit Matrix
Matrix

The unit MATRIX offers some of the most important operations to manage and process two-dimensional real and integer matrices. The object oriented approach of the unit MATRIX hides all stuff dealing with array addressing and memory management. Thus the user may fully concentrate on his/her work.

The unit MATRIX provides two classes, TMatrix and TIntMatrix, which contain a floating point and an integer matrix, respectively. MATRIX offers solutions for the following tasks:

- creation and management of matrices

- filling of matrices

- copying matrices

- matrix arithmetics

- determination of statistical parameters about the matrix elements

- inversion of a square matrix (TMatrix only)

- sorting of elements

For technical reasons, this help file is restricted to a single component or unit. If you want to have the cumulative help for all components available from SDL, you may download a free copy of the cumulative help from our web site:

http://www.lohninger.com/


Unit MatView
MatView

The unit MatView provides a class which visualizes the contents of a matrix by displaying rectangles proportional to the values of the single matrix elements. MatView is especially useful to select matrix cells, rows, or columns in a visual way.

For technical reasons, this help file is restricted to a single component or unit. If you want to have the cumulative help for all components available from SDL, you may download a free copy of the cumulative help from our web site:

http://www.lohninger.com/


Unit NTabed
NTabEd

The unit NTabEd contains a Delphi visual component which supports the display and editing of numeric tables. Each table consists of the data table, column and row attributes, column and row headers, and a comment line. All of these items can be manipulated either interactively or programmatically. The data table is based on the class TMatrix.

For technical reasons, this help file is restricted to a single component or unit. If you want to have the cumulative help for all components available from SDL, you may download a free copy of the cumulative help from our web site:

http://www.lohninger.com/


 Type Ambiguities

See also:

Some of the components of SDL have type definitions which are syntactically equal to each other. For organizational reasons they are declared separately in each unit. However, this approach may result in ambigous type declarations, if two or more of these components are used within the same program. The compiler generates the following error message:

Delphi:	Incompatible Types

C++Builder:	Ambiguity between 'xxx::ttt' and 'zzz::ttt'

If such a problem occurs, the user has to explicitely specify the unit, or name space of the type declaration by using the name of the unit preceding the actual identifier. The unit name is separated by a dot (or two colons in case of C++) from the identifier.

Example:	Suppose you are using the components Meter and Numlab on the same form. Both components have defined the property FrameStyle which is of the type TFrameStyle. In order to assign a new frame style during run-time you have to explicitely specify the unit which is used for the type definition:

NumLab1.FrameStyle := Numlab.fsRaised;

Meter1.FrameStyle := Meter.fsRaised;

or the same in C++:

NumLab1->FrameStyle = Numlab::fsRaised;

Meter1->FrameStyle = Meter::fsRaised;


How to order

Back to the Contents

For registration please run the program REGISTER.EXE (which prints the registration form) and send the printed form together with the proper amount of money (preferrably credit cards or cash, for cheques please add US$ 5,-) to the following address:

   SDL

   Software Development Lohninger

   P.O.B. 123

   A-1061 Vienna

   Austria, Europe

   email: helpdesk@lohninger.com

The components are preferrably delivered by electronic means (download from our update server after authorization by email). For quick delivery (within 24 hours), please fax the order form (credit card orders, only) to the fax number indicated at our home page:

http://www.lohninger.com/

There are several additional Delphi / C++Builder components, and other software products available from SDL. Ordering several components (w/o source code) together will entitle you to a discount:

2 components	-10 %

3..5 components	-20 %

more than 5	-30 %

Special Offer 1:

SDL Component Suite: Take all of our Delphi / C++Builder (w/o sources) and pay only US$ 55.

This offer includes:

* unlimited free updates via our webserver

* free support for both the Delphi and the C++Builder versions of the components

Special Offer 2:

SLD Component Suite Pro: Purchase the sources of all of our components and get a free subscription to all future components for only US$ 399. This offer includes:

* full source code of all components

* unlimited free updates via our webserver

* free subscription to future components: your component library is thus automatically growing month by month at no extra costs

* free support for both the Delphi and the C++Builder versions of the components

For the latest release of SDL´s Delphi and C++Builder components and for pricing information see http://www.lohninger.com/ or write to the address above.


A  Personal  Remark

We are putting much effort into the production of  most reliable components and units for other programmers. Everybody  who is using our software gets our expertise at a competitive price. But this is only possible if everybody who uses our software, registers it and pays for it. So, if you don't want to kill the shareware idea, don't hesitate to support our work and register this piece of software.

Hans Lohninger of SDL

Vienna, Austria.


Installing under C++Builder - Visual Component
C++Builder Installation - Visual Component

See also:	Delphi installation, SDL Component Suite Help

1. Installing the component into the C++ Builder 1.0 VCL

1.1	Copy the OBJ, the DFM, and the DCR files to the directory where the C++ Builder library is located  (XXX/CBuilder/Lib).

1.2	Copy the HPP file into the include directory (XXX/CBuilder/Include)

1.3	If not already running, start up C++Builder.

1.4	Click on Component, and then on Install. You can now add the new component by using the Add button (browsing for the OBJ  file is most convenient).

1.5	After you have added all the components to be installed, click on OK. C++ Builder will then add the selected components to the VCL on a palette entry called SDL.

2. Installing the component into the C++ Builder 3.0 VCL

2.1	Copy all HPP files to the include directory of C++Builder (XXX/CBuilder3/Include)

2.2	Copy all DFM, RES, and OBJ files to the object directory of C++Builder (XXX/CBuilder3/lib/obj)

2.3	Copy all BPL files to the binaries directory of C++Builder (XXX/CBuilder3/bin)

2.4	Copy all BPI, DCR, and LIB files to the library directory of C++Builder (XXX/CBuilder3/lib)

2.5	In the C++Builder main menu click on "Component", and then on "Install Packages". This starts the package installation window.

2.6a	If you have previously installed an earlier version of the package, select this earlier version and remove it by clicking on the "Remove" button.

2.6b	Now click on "Add" and select the package to be installed (all package names start with "sdl"). The packages can be found in the binaries directory of C++Builder (XXX/CBuilder3/bin). You may repeat step 2.6 for installing several packages

2.7	When done, click on OK. C++ Builder will then add the selected components to the VCL on a palette entry called SDL.

3. Adding the help file to the C++Builder help system

3.1  (optional) Copy the HLP file(s) to the help directory of C++Builder

3.2  Run the OpenHelp application from the C++Builder group menu.

3.3  Click on the "Add" button, and add the help file(s) to the "Available Help Files" list

3.4  Select the help file(s) and click on ">"

3.5  Click on OK. Thereafter the C++Builder help system knows about the new component(s).

As an alternative, you could install the cumulative help file SDLSUITE.HLP which covers all components of SDL. The cumulative help is available for free at the following web site:

http://www.lohninger.com/


Installing under Delphi - visual component
 Delphi Installation - Visual Component

See also:	C++ Builder installation, SDL Component Suite Help

1. Installing the component into the Delphi VCL

1.1. Installation under Delphi, versions 1, 2, and 3

1.1.0	There are several subdirectories in the distributed package named delphi10, delphi20, delphi30, cppbuild1, and cppbuild3. Select the proper Delphi subdirectory.

1.1.1	Copy the DCU, RES, DFM, and DCR files to the directory where the Delphi library is located. If not already running, start up Delphi. Please note: some of the components may consist of several DCU files. In this case, only the master DCU file (which has the same name as the component) has to be installed as described below.

1.1.2a	Delphi 1: click on Options, and then Install Components.

1.1.2b	Delphi 2: click on Component, and then on Install..

You can now add the new component by using the Add button (browsing for the DCU file is most convenient).

1.1.2c	Delphi 3: click on Component, and then on Install Component....

You can now add the new component by selecting the proper package and browsing for the DCU file of the component to be installed.

1.1.3	After you have added all the components you want to install, click on OK. Delphi will then add the selected components to the VCL on a palette entry called SDL.

1.2. Installing the components under Delphi 4

1.2.1. If not already running, start up Delphi 4.

1.2.2. If you have installed a previous (shareware) copy, uninstall it

1.2.3. Select the subdirectory delphi40 of the distribution files

1.2.4. Copy all files of this directory to the Delphi compiler directory (usually  '...\Delphi 4.0\Bin')

1.2.5. Click on "Component" and then on "Install Packages ..."

1.2.6. Click on "Add.." and browse the Delphi library path for sdl*.dpl files

1.2.7. Select the package to be installed

1.2.8. Optinonally, repeat the addition of other packages

1.2.9. Click on OK. Thereafter the selected component(s) are available on the VCL palette using the folder "SDL"

Note:	If you are installing several or all of the SDL components, the order of installation is important because some packages require others to be already installed. Here is a sample order which works: CDATA, CFORM, STRINGL, MATH1, VECTOR, MATRIX, MATH2, NTABED, NUMLAB, RCHART, ROT3D, NUMIO, STATIS, DSTRUCT, DIRTREE, COLSEL, FOURIER, METER

2. Merging the help keywords into the master help index

2.1	Copy the HLP and the KWF files to the directory where the master help file DELPHI.HLP is located (usually \DELPHI\BIN).

2.2	Run the HELPINST application from the Delphi group menu.

2.3	Open the master index DELPHI.HDX

2.4	Add the keyword file (.KWF)

2.5	Save and compile the new index. Thereafter the Delphi master help index includes the keywords for the component's Help screens.

As an alternative, you could install the cumulative help file SDLSUITE.HLP into the Delphi Tools menu. This approach is far better and much more reliable than merging the help files into the master help index (at least for Delphi 1). The cumulative help is available for free at the following web site:

http://www.lohninger.com/

-------------------------------

Note:	Assure yourself that the PATH environment variable includes the directory where the help file is stored. Otherwise the Windows help system will not find the new help file. Alternatively, you can copy the help file to the Windows directory.


Delphi and C++Builder Issues

See also:

C++Builder users of class TVector:

Don’t mix up the class TVector with the vector class of the Rogue Wave Standard C++ Library. (Sorry for the duplicate naming).

Any component of SDL comes both for the Delphi and the C++Builder environment. Thus, you get full support both for Delphi and C++Builder with our components. The following general directory layout of the delivered zip files makes it easier to access the parts you need:

Please note, that the RES files of the sample applications are supplied both as a 16-bit and a 32-bit version (denoted by the extension RES16, and RES32). You have to rename the proper version to RES before compiling the sample applications.


Installing the SDL Component Suite Help
 Installation of the SDL Component Suite Help

See also:	C++ Builder installation, Delphi installation

If you want to install the SDL Component Suite help file into the tools menu of the Delphi or C++Builder IDE, you have to perform the folowing steps:

Delphi 1.0

1.	Click on the "Options" command in the main menu

2.	Click on "Tools..." in the submenu

3.	Click on "Add..." in the tools window

4a.	Enter a title for the help file (e.g. "SDL Help")

4b.	Browse your computer for the program "Winhelp.exe" (which is normally located in the Windows directory "c:\windows")

4c.	In the "Parameters" box, enter the full path of the help file (e.g. "d:\delphi20\compiler\help\sdl16.hlp")

4d.	Click on "OK", and then on "Close"

The cumulative help of the Delphi Componente Suite should now be available from the "Tools" menu of Delphi 1

Delphi 2.0/3.0/4.0, C++Builder 1.0/3.0

1.	Delphi 2, and 3: Click on the "Tools" command in the main menu

2a.	Delphi 2: Click on "Tools..." in the submenu

2b.	Delphi 3 & 4, C++Builder: Click on "Configure Tools..." in the submenu

3.	Click on "Add..." in the tools window

4a.	Enter a title for the help file (e.g. "SDL Help")

4b.	Browse your computer for the program "Winhlp32.exe" (which is normally located in the Windows directory "c:\windows")

4c.	In the "Parameters" box, enter the full path of the help file (e.g. "d:\delphi20\compiler\help\sdl32.hlp")

4d.	Click on "OK", and then on "Close"

The cumulative help of the Delphi Componente Suite should now be available from the "Tools" menu of the IDE.


Nag Hints in the Registered Version
 How to get rid of the nag hints in the registered versions

See also:

Question:

I recently registered this component and installed what I downloaded from the SDL update area. However, the component still lists itself to be the unregistered version.

Answer:

1) you have an old unregistered version of the component somewhere lurking on your harddisk (use the file find utility of the Windows explorer to check that). If so, remove it, deinstall the shareware copy from the VCL and install the registered version again.

2) another often experienced reason can be found in the fact that the Hint property is just set to the shareware message (from previous usage of the unregistered component). In this case, you should simply change the Hint property and/or turn the ShowHint property off.

A simple check whether the registered or the unregistered component has been linked into your program can be performed by starting the application program without running Delphi and/or C++Builder on the system. If the application uses the unregistered component, the program should overwrite the component area with a copyright message. In this case see point 1 above, otherwise point 2.


Linker error when installing RChart
I run into linker error when installing RChart

See also:	Installation of RChart

Question:

I followed the installation instructions but got a linker error when installing RChart:

[Linker Err] Undefined symbol Rcbakbmp::Register[] __fastcall referenced ....

[Linker Err] Undefined symble Rccommon::Register[] __fastcall referenced .....

What's wrong ?

Answer:

Previous versions of RChart (earlier than release 4.00) needed two additional files, RCBAKBMP and RCCOMMON, which contained some basic routines and declarations. These files are not for VCL installation. The only purpose for these files was to circumvent the 64k restrictions of Delphi 1.0. Release 4.00 and higher of RChart does no longer support Delphi 1.0 and thus does not need these files anymore.

In case you encounter this error (if you use an older version of RChart), you tried to install one of these additional files along with RCHART into the VCL. Do not install them, just copy these files to the library directory of Delphi/C++Builder.


Moving the viewing port of RChart
How to quickly move the viewing port of RChart

See also:

With charts containing a large number of graphics items, you have to be careful to avoid triggering the OnPaint event more than once. One way to get the most speed is as follows:

1) Set the property AutoRedraw to false

2) Use the method SetRange to set the coordinates of the new viewing port at once.

3) Call the method ShowGraf

As a rule of thumb on the maximum speed of changing the viewport, you should compare to the pan action if the mouse property MouseAction is set to maPan.


PCA is too slow
The calculation if the principal components is too slow

See also:	CalcPrincComp

Question:

The principal component calculation of unit Math2 is so slow if there are many variables involved.

Answer:

If the calculation of the principal components is too slow, this usually arises from a transposed data matrix with a lot of columns but only a few rows. If you face such a problem you can dramatically speed up the calculations by transposing the data matrix prior to the calculation, and exchanging loadings and scores after it. Note that this trick only works if the number of rows is considerably less than the number of columns of the data matrix.


Frequently asked questions
 Frequently Asked Questions  /  Tips and Tricks

See also:

Registered vs. shareware versions; license and update policy

I can't get rid of the nag hints after buying the registered version

Do I have to pay any royalties if I develop a commercial application using your components ?

How many licenses are required, given that several programmers of our team are using SDL's components ?

If I purchase SDL components now, do I get any updates for the next release of Delphi/C++Builder ?

I loaded the registered version from your update area, however it seems that the downloaded software is a shareware copy

Tips and tricks, common problems

How to quickly move the viewing port of RChart

The principal component analysis is so slow with many variables

What is the maximum number of points RChart can display ?

The mouse cursor does not change to its default state when moved outside RChart.

I get an "access violation error", when using TMatrix.

Installation problems

I run into linker error when installing RChart

How to get SDL help suite installed so that Delphi help recognizes it.

I cannot install unit XYZ into the Delphi/C++Builder VCL


Royalties

See also:

Question:

Do I have to pay any royalties if I develop a commercial application using your components ?

Answer:

No, definitely not. You are free to use the registered components in your commerical applications without paying any royalties to us. However, you (1) must not give away any DCU or PAS files bought from us, and (2) you must not create and deploy any similar components based on our components.


Max. Number of Data Points
Maximum number of points RChart can display ?

See also:

Question:

What is the maximum number of points RChart can display ?

Answer:

The maximum number of points is limited only by computer memory. However, the display gets slower with more points in the chart. We have tested it with up to 100000 data points.


Site Licenses

See also:

Question:

Our development team consists of five programmers. How many licenses do you require to be purchased, given that each programmer will need a copy of the component installed on their machine? Are there any discounts available in this situation?

Answer:

You need a license for each of the programmers working with our components. However we offer the following discounts

2 licenses: -10%

3..5 licenses: -20%

6..10 licenses: -30%

more than 10 licenses: please ask

Each programmer of your team will be supported by our update policy as if he/she had ordered it by their own. This includes regular updates and hotline support by email.


Installation of SDL Help
Installation of SDL Help into Delphi/C++Builder

See also:

Question:

How to get SDL help suite installed so Delphi help recognizes it.

Answer:

Help files are a still unresolved problem with Delphi. If the keyword file is getting too large, then the help system crashes. So we recommend to install the SDL help into the Tools section of the Delphi IDE. This is less convenient but it works.


Access Violation Error
Access violation errors with TMatrix and TVector

See also:	TMatrix.Create

Question:

I am having some difficulty with matrix assignments. The following code produces access violation errors:

procedure TForm1.XXX (Sender: TObject);

var

  userdata : Tmatrix;

begin

userdata.Create(5,5);

userdata.elem[1,1] := 2.332;  <--- this assignment causes the problems

....

Answer:

You made a mistake in creating the matrix. The correct statement should read like this:

...

begin

userdata := TMatrix.Create (5,5);   <--- mind the difference !

userdata.elem[1,1] := 2.332;        <--- no problems any more

...


Mouse Cursor in RChart
Mouse cursor behavior in connection with RChart

See also:	MouseAction

Question:

When the mouse cursor moves out of the RChart component fast, it retains the cursor type assigned by the component (say, cross or hand). It does not happen when the mouse is moved slowly.

Answer:

This is not a problem of RChart but of the Windows messaging system. See also hint 1 in the MouseAction page of the RChart help file.


Updates
Updates for new compiler releases

See also:

Question:

If I purchase SDL components now, do I get any updates for the next release of Delphi/C++Builder ?

Answer:

If you purchase our components, you get all upgrades for future compiler versions for free (via our update server). More information on our update policy can be found on our web site: http://www.lohninger.com/udarea.html


Installation of non-visual components

See also:

Question:

I cannot install unit XYZ into the Delphi/C++Builder VCL. I get an undefined reference in the XYZ object that goes something like this:

Undefined reference XYA::Register() in .....

Answer:

Some of the SDL units are non-visual components (for example MATH1, or MATRIX, or CDATA, ...) which cannot be installed into the VCL palette. The units are to be used in your application by simply including the unit name into the uses statement of your program (don't forget to set the library path to your unit files).


Registered and Shareware Copies
 Registered version behaves like shareware copy

See also:	shareware Hint property

Question:

I loaded the registered version from the SDL update area, however it seems that the downloaded software is a shareware copy

Answer:

You can be assured that any copy obtained from our update server is registered. The most common reason for this problem is that there are several copies of the software (some shareware, some registered) lurking somewhere on your hard disk, and the linker/procject pathes point to an unregistered copy.