dotnetCHARTING Send comments on this topic.
DataSource Property
See Also  Example
dotnetCHARTING Namespace > Annotation Class : DataSource Property


Gets or sets the DataSource object used to replace tokens in this annotation's label, tool tip, and URL.

Syntax

Visual Basic (Declaration) 
Public Property DataSource As Object
Visual Basic (Usage)Copy Code
Dim instance As Annotation
Dim value As Object
 
instance.DataSource = value
 
value = instance.DataSource
C# 
public object DataSource {get; set;}

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.
C#Copy Code
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'.
    
Visual BasicCopy Code
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

Remarks

Data sources include Element, Series, and AxisMarker objects. When the source is specified, any tokens associated with the source type may be used.

See Also

© 2010 All Rights Reserved.