TdxCustomFlowChart.CreateObject(Integer,Integer,Integer,Integer,TdxFlowChartObjectAdvancedShape) Method
Creates an advanced chart symbol in the control.
Declaration
function CreateObject(L: Integer; T: Integer; W: Integer; H: Integer; AAdvancedShape: TdxFlowChartObjectAdvancedShape): TdxFcObject; overload;
Parameters
Name | Type | Description |
---|---|---|
L | Integer | A distance between the client area’s left border and the created chart symbol’s bounding rectangle, in pixels. |
T | Integer | A distance between the client area’s top border and the created chart symbol’s bounding rectangle, in pixels. |
W | Integer | The width (in pixels) of the created chart symbol. |
H | Integer | The height (in pixels) of the created chart symbol. |
AAdvancedShape | TdxFlowChartObjectAdvancedShape | An advanced shape from the control’s repository. |
Returns
Type | Description |
---|---|
TdxFcObject | A chart symbol. |
Remarks
Call this function to place an advanced chart symbol at the specified point within the control’s area.
The code example below shows how to create and customize an advanced shape:
uses
// Contains the TdxFlowChartObjectAdvancedShape class declaration
..., dxFlowChartShapes;
var
AObj: TdxFcObject;
// Declared at the dxFlowChartShapes unit;
AAdvancedShape: TdxFlowChartObjectAdvancedShape
begin
// Assigns the "Off Page Reference" shape from the advanced shape repository to the AAdvancedShape variable
AAdvancedShape := dxFlowChart1.Repository.BasicFlowchartShapes.OffPageReference;
// Adds the advanced shape with predefined dimensions to the specified position
AObj := dxFlowChart1.CreateObject(10, 10, 200, 100, AAdvancedShape);
// Fills the shape's background with the silver color
AObj.BkColor := clSilver;
// Fills the shape's background with the gray color
AObj.ShapeColor := clGray;
// Sets text to display within the shape
AObj.Text := 'Document';
// Centers text horizontally within the shape
AObj.HorzTextPos := fchpCenter;
// Centers text vertically within the shape
AObj.VertTextPos := fcvpCenter;
// Rotates the shape clockwise by 45 degrees
AObj.Angle := 45;
end;
You can call the CreateObject(Integer,Integer,Integer,Integer,TdxFcShapeType) function to create a shape from a predefined set. Note that this set has a limited number of shapes compared to the repository.