TdxCustomFlowChart.CreateConnection(TdxFcObject,TdxFcObject,Byte,Byte) Method
Creates a new connection between the specified chart symbols.
Declaration
function CreateConnection(OSrc: TdxFcObject; ODst: TdxFcObject; PSrc: Byte; PDst: Byte): TdxFcConnection;
Parameters
Name | Type |
---|---|
OSrc | TdxFcObject |
ODst | TdxFcObject |
PSrc | Byte |
PDst | Byte |
Returns
Type |
---|
TdxFcConnection |
Remarks
Call this function to bind the OSrc and ODest chart symbols. The function returns a new connection that attaches to the PSrc and PDst anchor points of the two specified chart symbols, respectively.
The CreateConnection function uses the point’s ID as the PSrc and PDst parameters values.
The code example below shows how to bind two advanced shapes with connection:
var
AConnection: TdxFcConnection;
AObj1, AObj2: TdxFcObject;
begin
// Provides access the first shape in the control (Refer to the CreateObject method's code example)
AObj1 := dxFlowChart1.Objects[0];
AObj2 := dxFlowChart1.Objects[1];
// Attaches the connection to shapes at the specified points
AConnection := dxFlowChart1.CreateConnection(AObj1,AObj2,0,2);
// Sets one-pixel width for the connection line
AConnection.PenWidth := 1;
// Sets the dashed line for the connection
AConnection.PenStyle := psDash;
// Sets the straight line for the connection
AConnection.Style := fclStraight;
// Sets text to display within the connection
AConnection.Text := 'Connection';
// Fills the connection with the gray color
AConnection.Color := clGray;
// Assigns no shape to the connection's start arrow
AConnection.ArrowSource.ArrowType := fcaNone;
// Assigns the "Filled Arrow" shape to the connection's destination arrow
AConnection.ArrowDest.ArrowType := fcaFilledArrow;
end;
See Also