Use the OuterIndents and OuterIndents properties (whose values are summarized) to specify the indents between the body of an annotation and its parent element's edges.
For more information, refer to Annotations Position and Layout.

Example
This example demonstrates how text and image annotations can be created and anchored to a chart, pane or series point.
Form1.cs |
using System;
using System.Drawing;
using System.Windows.Forms;
using DevExpress.XtraCharts;
private void Form1_Load(object sender, EventArgs e) {
chartControl1.AnnotationRepository.Add(new TextAnnotation("Annotation 1"));
chartControl1.AnnotationRepository[0].AnchorPoint =
new SeriesPointAnchorPoint(chartControl1.Series[0].Points[2]);
chartControl1.Annotations.AddImageAnnotation("Annotation 2",
Bitmap.FromFile(@"...\...\image.png"));
((ChartAnchorPoint)chartControl1.Annotations[0].AnchorPoint).X = 150;
((ChartAnchorPoint)chartControl1.Annotations[0].AnchorPoint).Y = 150;
XYDiagramPaneBase myPane = ((XYDiagram)chartControl1.Diagram).Panes[0];
((FreePosition)chartControl1.Annotations[0].ShapePosition).DockTarget = myPane;
((FreePosition)chartControl1.Annotations[0].ShapePosition).DockCorner = DockCorner.RightTop;
myPane.Annotations.AddImageAnnotation("Annotation 3", Bitmap.FromFile(@"...\...\image.png"));
((PaneAnchorPoint)myPane.Annotations[0].AnchorPoint).AxisXCoordinate.AxisValue = 2;
((PaneAnchorPoint)myPane.Annotations[0].AnchorPoint).AxisYCoordinate.AxisValue = 180;
((RelativePosition)myPane.Annotations[0].ShapePosition).Angle = -135;
((RelativePosition)myPane.Annotations[0].ShapePosition).ConnectorLength = 50;
TextAnnotation myTextAnnotation =
(TextAnnotation)chartControl1.AnnotationRepository.GetElementByName("Annotation 1");
ImageAnnotation myImageAnnotation =
(ImageAnnotation)chartControl1.AnnotationRepository.GetElementByName("Annotation 3");
myTextAnnotation.Text = "<i>Basic</i> <b>HTML</b> <u>is</u> <color=blue>supported</color>.";
myImageAnnotation.RuntimeMoving = true;
myImageAnnotation.RuntimeAnchoring = true;
myImageAnnotation.RuntimeResizing = true;
myImageAnnotation.RuntimeRotation = true;
myImageAnnotation.SizeMode = ChartImageSizeMode.Tile;
myImageAnnotation.ShapeKind = ShapeKind.RoundedRectangle;
myImageAnnotation.ShapeFillet = 10;
myImageAnnotation.ConnectorStyle = AnnotationConnectorStyle.Arrow;
}
|
Form1.vb |
Imports System
Imports System.Drawing
Imports System.Windows.Forms
Imports DevExpress.XtraCharts
' ...
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
' Add a text annotation to the chart control's repository.
chartControl1.AnnotationRepository.Add(New TextAnnotation("Annotation 1"))
' And, assign a series point to the annotation's AnchorPoint property.
' This adds the annotation to the series point's Annotations collection.
chartControl1.AnnotationRepository(0).AnchorPoint = New SeriesPointAnchorPoint(chartControl1.Series(0).Points(2))
' Now, create an image annotation, and add it to the chart's collection.
chartControl1.Annotations.AddImageAnnotation("Annotation 2", Bitmap.FromFile("...\...\image.png"))
' Define the X and Y absolute coordinates for the annotation, in pixels.
CType(chartControl1.Annotations(0).AnchorPoint, ChartAnchorPoint).X = 150
|