EqapMonitorChart (version 1.0, 05.12.2009)
The EqapMonitorChart is a part of EqapPackage and is a visual component designed for quick drawing of time-based signals like an ECG-monitor does it.
1. Appearance
The EqapMonitorChart is a graphical area for drawing of the signals. The area has three axes - left and right vertical and bottom horizontal, and grid (Fig. 1). Background color, axis color, axis labels font and grid parameters can be asigned at Design-time mode. Signal colors can be assigned at Run-time mode (see Example below).
Fig. 1. EqapMonitorChart component
An user can assign maximal and minival values of an axis at Run-time mode. Click right mouse button over the axis area (around the axis line or over axis labels) to show the corresponding dialog box (Fig. 1). Current maximal/minimal values of left/right (not bottom) axis can also be changed directly by clicking of left mouse button on the axis area, holding the button pressed and moving the mouse cursor up or down. The cursor position, calculated as coordinate on both left and right axes, is shown above the corresponding vertical axis line and colored accordingly to the axis color, and the cursor position, calculated as coordinate on bottom axis, is shown on the left side below the horizontal axis (Fig. 1).
2. Properties and events
The EqapMonitorChart inherits properties and events of TPanel except all of those used for visual drawing and text appearance (Alignment, AutoSize, BevelInner, BevelOuter, BorderStyle, Caption, Font etc.), and has own properties and events:
Properties
AxisMoveSensitivity: integer - the single step of axis maximal/minimal values alteration, when these are changed by an user with mouse. The smaller the value, the larger this step. The default value is "5".
BackColor: TColor - background color. The default value is "clBlack".
BottomAxis, LeftAxis, Rightxis: TEqapMonitorChartAxis - axis drawing properties. Three sub-properties are available - Color: TColor (axis line/label color), Max: integer (current maximal value) and Min: integer (current minimal value).
Grid: TPen - grid drawing properties. Three sub-properties are available - Color: TColor (grid color), Style: TPenStyle (grid line style) and Width: integer (grid line width).
LabelFont: TFont - axes labels font.
Options: TEqapMonitorChartOptions - component options. The option emcoShowCurrentCoordinates indicates whether the cursor coordinates must be drawn. The default value is "true".
Events
OnBottomAxisSetMinMax, OnLeftAxisSetMinMax, OnRightAxisSetMinMax: TNotifyEvent - event arises when user closes the dialog box for maximal/minimal values selection by pressing "OK" button (see Fig. 1).
3. The example of using
The EqapMonitorChart1 and standard Timer1 have been placed on Form1. Please, include EqapCommon in uses section prior to compilation (constant "caLeft" is used). The OnTimer event of Timer1 is assigned, the property "Interval" is set to "1". The global variable "Count" (an integer type) is declared. Timer1 is enabled when TForm1.OnCreate event occurs. At the application start, the sinus-like signal is drawing on EqapMonitorChart1.
procedureTForm1.FormCreate(Sender: TObject);
begin
Count:=0;
Timer1.Enabled:=true;
end;procedure TForm1.Timer1Timer(Sender: TObject);
begin
EqapMonitorChart1.DrawPixel(Count,100*Sin(Count/100),caLeft,clYellow);
Inc(Count);
end;
All the software products are free for use. Any commercial using is not permitted without author's permission (o.lookin@iip.uran.ru).