Skip to main content
A newer version of this page is available. .

Annotation.ShapePosition Property

Specifies the annotation position.

Namespace: DevExpress.Xpf.Charts

Assembly: DevExpress.Xpf.Charts.v19.1.dll

Declaration

public AnnotationShapePosition ShapePosition { get; set; }

Property Value

Type Description
AnnotationShapePosition

An AnnotationShapePosition class descendant representing the shape position type.

Remarks

The ShapePosition property can be specified as the RelativePosition or FreePosition type.

The following table contains the various types of the annotation shape position.

The Property Values

The Example Image

Description

ShapePosition = RelativePosition

RelativePositionAngle

If the Annotation.ShapePosition property is specified as the RelativePosition type, the annotation shape position can be modified using the RelativePosition.ConnectorLength and RelativePosition.Angle properties.

In this example the ConnectorLength property is specified to 70 and the RelativePosition.Angle property to 45.

ShapePosition = FreePosition

X_Y_Coordinates

The Annotation.ShapePosition property is specified as the FreePosition type. The annotation layout can be specified using the FreePosition.VerticalAlignment and FreePosition.HorizontalAlignment properties. The parent element can be defined using the FreePosition.DockTarget property. Define the indents from the parent element edges using the Annotation.Margin property.

In this example, the annotation is docked to a Chart control. The HorizontalAlignment property is specified as Right, the VerticalAlignment as Top. The Margin property is defined as (0, 90, 50, 0).

Example

This example demonstrates how to anchor an annotation to a series point.

To do this, specify the SeriesPointAnchorPoint.SeriesPoint property.

<dxc:Annotation Content="Annotation #1">
    <dxc:Annotation.AnchorPoint>
        <dxc:SeriesPointAnchorPoint SeriesPoint="{Binding ElementName=seriesPoint}"/>
    </dxc:Annotation.AnchorPoint>
    <dxc:Annotation.ShapePosition>
        <dxc:RelativePosition Angle="60" 
                              ConnectorLength="50"/>
    </dxc:Annotation.ShapePosition>
</dxc:Annotation>

The following code snippets (auto-collected from DevExpress Examples) contain references to the ShapePosition property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also