Skip to main content

TdxChart.AddDiagram(TdxChartDiagramClass,string) Method

Creates a new diagram with the specified title.

Declaration

function AddDiagram(ADiagramClass: TdxChartDiagramClass; const ACaption: string = ''): TdxChartCustomDiagram; overload;

Parameters

Name Type Description
ADiagramClass TdxChartDiagramClass

Specifies the type of the created diagram.

Pass a reference to a TdxChartCustomDiagram class to create a diagram of the corresponding type.

ACaption string

Optional. Specifies the created diagram’s title

Returns

Type Description
TdxChartCustomDiagram

The created diagram.

Cast the returned object to the [TdxChartXYDiagram] or [TdxChartSimpleDiagram] class depending on the actual diagram type (ADiagramClass) to access all public members.

Remarks

The AddDiagram function can create diagrams of any supported type. The ADiagramClass parameter accepts a reference to one of the following TdxChartCustomDiagram class descendants:

TdxChartXYDiagram
An XY diagram in the Chart control.
TdxChartSimpleDiagram
A simple diagram in the Chart control.

Important

Do not call the AddDiagram function in your code. To create diagrams in the Chart control, call its AddDiagram function instead.

See Also