DataSource Property (Annotation)
Gets or sets the DataSource object used to replace tokens in this annotation's label, tool tip, and URL.
Syntax
'Declaration Public Property DataSource As Object
'Usage Dim instance As Annotation Dim value As Object instance.DataSource = value value = instance.DataSource
public object DataSource {get; set;}
Remarks
Data sources include Element, Series, and AxisMarker objects. When the source is specified, any tokens associated with the source type may be used.
Example
Instantiates a series and annotation. Sets the series as the DataSource of the annotation. Specifies the '%Name' series token as for the annotation's label. Adds the annotation to a chart.
Series mySeries = new Series(); mySeries.Name = "Test Series"; Annotation a = new Annotation(); a.DataSource = mySeries; a.Label.Text = "%Name"; Chart.Annotations.Add(a); // When this chart renders, the annotation will read 'Test Series'.
Dim mySeries As New Series() mySeries.Name = "Test Series" Dim a As New Annotation() a.DataSource = mySeries a.Label.Text = "%Name" Chart.Annotations.Add(a) ' When this chart renders, the annotation will read 'Test Series'.
Example
Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
See Also