Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TdxChart.AddDiagram(TdxChartDiagramClass,string) Method

Creates a new diagram with the specified title.

#Declaration

Delphi
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