New to Telerik UI for WinFormsStart a free 30-day trial

CartesianFreeFigureAnnotation

Updated over 6 months ago

CartesianFreeFigureAnnotation allows you to add an annotation in RadChartView that is formed by a set of FreeFigurePoints. This allows you to create a free figure plotted on the view-port. Each FreeFigurePoint is defined by X and Y values.

Figure 1: CartesianFreeFigureAnnotation

WinForms RadChartView Cartesian Free Annotation

Define Annotation

C#
ScatterSeries scatterSeries = new ScatterSeries();
scatterSeries.Name = "ChartData";
scatterSeries.DataPoints.Add(new ScatterDataPoint(15, 19));
scatterSeries.DataPoints.Add(new ScatterDataPoint(18, 10));
scatterSeries.DataPoints.Add(new ScatterDataPoint(13, 15));
scatterSeries.DataPoints.Add(new ScatterDataPoint(10, 8));
scatterSeries.DataPoints.Add(new ScatterDataPoint(5, 12));
scatterSeries.DataPoints.Add(new ScatterDataPoint(20, 20));
scatterSeries.DataPoints.Add(new ScatterDataPoint(15, 10));
scatterSeries.DataPoints.Add(new ScatterDataPoint(7, 6));
scatterSeries.DataPoints.Add(new ScatterDataPoint(18, 22));
scatterSeries.DataPoints.Add(new ScatterDataPoint(10, 10));
scatterSeries.PointSize = new SizeF(8, 8);
this.radChartView1.Series.Add(scatterSeries);

CartesianFreeFigureAnnotation freeAnnotation = new CartesianFreeFigureAnnotation();
freeAnnotation.Points.Add(new FreeFigurePoint(6, 8));
freeAnnotation.Points.Add(new FreeFigurePoint(8, 15));
freeAnnotation.Points.Add(new FreeFigurePoint(15, 17));
freeAnnotation.Points.Add(new FreeFigurePoint(17, 8));
freeAnnotation.Points.Add(new FreeFigurePoint(12, 5));
freeAnnotation.Points.Add(new FreeFigurePoint(6, 8));

freeAnnotation.CloseFigure = true;
freeAnnotation.Spline = false;
freeAnnotation.Label = "Annotation";
freeAnnotation.Font = new Font("Arial", 12f, FontStyle.Regular);
freeAnnotation.BackColor = Color.FromArgb(50, 37, 160, 219);
freeAnnotation.BorderDashStyle = DashStyle.Custom;
freeAnnotation.BorderDashPattern = new float[] { 9, 3, 2, 4 };
freeAnnotation.BorderColor = Color.Orange;
freeAnnotation.BorderWidth = 2;

freeAnnotation.PointShape = new StarShape();
freeAnnotation.PointSize = new SizeF(24, 24);
this.radChartView1.Annotations.Add(freeAnnotation);

Properties

PropertyDescription
LabelGets or sets the label.
PointSizeGets or sets the point size.
PointShapeGets or sets the point shape.
PointsGets the collection of data points.
CloseFigureDetermines whether the figure will be closed by connecting a line from the endpoint to the starting point.
SplineGets or sets a value indicating whether the annotation will be drawn as a spline.
SplineTensionGets or sets a value indicating the tension of the spline. Spline property must be set to true for this property to have effect.
PositonOffsetAllows you to specify the offset for the label.

See Also

In this article
PropertiesSee Also
Not finding the help you need?
Contact Support