The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



Arrow


Unit: SDL_rchart
Class: TRChart
Declaration: [1] procedure Arrow (x1,y1, x2,y2: double; HeadSize: integer);
[2] procedure Arrow (x1,y1, x2,y2: integer; HeadSize: integer);
[3] procedure Arrow (x1,y1: integer; x2,y2: double; HeadSize: integer);
[4] procedure Arrow (x1,y1: double; x2,y2: integer; HeadSize: integer);
[5] procedure Arrow (x1: integer; y1: double; x2: integer; y2: double; HeadSize: integer);
[6] procedure Arrow (x1: double; y1: integer; x2: double; y2: integer; HeadSize: integer);

The method Arrow draws an arrow from the point (x1,y1) to the point (x2,y2). The arrow can be drawn in different coordinate system modes: version [1] uses the world coordinates (these are the coordinates shown at the axes of the chart), version [2] uses the screen coordinates in pixels, and versions [3] to [6] mix them. Using screen coordinates (which are declared as integer) has the effect that the arrow remains at a fixed position even if the chart is panned or zoomed. Using mixed mode coordinates ([3] and [4]) allows to implement a "stretching" effect, with one end of the arrow staying in place and the other moving with the world coordinate system, versions [5] and [6] allow to fix either the x or the y positions of the arrow.

The colors of the arrow are controlled by the properties DataColor and FillColor. The first controls the color of the arrow line and the edges of the arrow head, the latter controls the fill color of the arrow head.

The parameter HeadSize determines the size of the arrow's head (in pixels!). Please note that a minimum size of 4 is required to draw acceptable arrowheads.

The drawing cursor is set to the position (x2,y2). The coordinates are real coordinates of the chart window. The line width of the arrow may be adjusted by the property LineWidth.

 

Hint 1: There is a special situation if the PenStyle property is not set to psSolid: normally, the properties DataColor and FillColor control the colors of a dashed or dotted line. However, if both the DataColor and the FillColor are the same, the second color of the dashed line is automatically set to clWhite or to clBlack (depending on the lightness of DataColor) in order to guarantee a visible dashed or dotted line. Thus you can draw a dashed arrow line even if both colors are the same.

Hint 2: In the Light Edition the number of chart elements is restricted to 1000 elements.



Last Update: 2023-Dec-13