dotnetCHARTING Send comments on this topic.
Annotation Class
See Also  Members   Example 
dotnetCHARTING Namespace : Annotation Class


Encapsulates a Box object with a position, data source, and hot spot functionality.

Object Model









Syntax

Visual Basic (Declaration) 
Public Class Annotation 
   Inherits Box
Visual Basic (Usage)Copy Code
Dim instance As Annotation
C# 
public class Annotation : Box 

Example

The following code snippet demonstrates using an annotation to simulate a text link on the chart.
Visual BasicCopy Code
Dim a2 As Annotation = New Annotation("Annotation text.")

'set the position
a2.Position = New Point(60,40)

'We'll add a link so when this text is clicked it takes us to a web site.
a2.URL = "http://www.dotnetcharting.com"

' Make sure the annotation doesn't create a rectangle for the text and wrap it.
a2.DynamicSize = False

'In order for the annotation not to draw the background, outline and so
'on... We'll use a shortcut to clear the colors.
a2.ClearColors()

'Add the annotation to a chart.
Chart.Annotations.Add(a2)
C#Copy Code
Annotation a2 = new Annotation("Annotation text.");

//set the position
a2.Position = new Point(60,40);

// We'll add a link so when this text is clicked it takes us to a web site.
a2.URL = "http://www.dotnetcharting.com";

// Make sure the annotation doesn't create a rectangle for the text and wrap it.
a2.DynamicSize = false;

// In order for the annotation not to draw the background, outline and so
// on... We'll use a shortcut to clear the colors.
a2.ClearColors();

// Add the annotation to a chart.
Chart.Annotations.Add(a2);
    

Example

Remarks

Annotations can either be instantiated for an Element or added to the Chart.Annotation collection. When attached to an element, the annotation will follow the element's position (unless specified) and have a spike indicating which element it's referring to.

When an annotation does not have a size or any text specified and it's Box.Background has an image, the size is will become that of the background's image.

Inheritance Hierarchy

System.Object
   dotnetCHARTING.Box
      dotnetCHARTING.Annotation

See Also

© 2008 All Rights Reserved.