Class ChartSeriesAnnotation
Represents chart series annotation class.
Inheritance
Namespace: Syncfusion.Windows.Chart
Assembly: Syncfusion.Chart.Wpf.dll
Syntax
public class ChartSeriesAnnotation : DependencyObject, INotifyPropertyChanged, IChartSerializer
Remarks
Annotations at specific X-Y coordinates can be added to the chart programmatically.
Examples
XAML:
<sfchart:ChartSeries Name="series1" Label="Series1" Type="Area"
Interior="LightSkyBlue">
<sfchart:ChartSeries.Annotations>
<sfchart:AnnotationsCollection LineColor="White" x:Uid="Annot">
<!-- Here we define the look and feel of the annotation. -->
<sfchart:AnnotationsCollection.AnnotationsTemplate>
<DataTemplate>
<Button Content="{Binding Y}" ToolTip="{Binding
Description}" Background="LightGray" Name="Button1" Click="Button_Click" />
</DataTemplate>
</sfchart:AnnotationsCollection.AnnotationsTemplate>
</sfchart:AnnotationsCollection>
<!-- The annotations are added to this collection in code-behind -->
</sfchart:ChartSeries.Annotations>
</sfchart:ChartSeries>
C#:
// Series1 annotations
ChartSeriesAnnotation ser1LowPoint = new ChartSeriesAnnotation() { X = 1, Y =
20, Description = "Series 1 Low Point" };
ChartSeriesAnnotation ser1HighPoint = new ChartSeriesAnnotation() { X = 7, Y =
56, Description = "Series 1 High Point" };
this.Chart1.Areas[0].Series[0].Annotations.Items.Add(ser1LowPoint);
this.Chart1.Areas[0].Series[0].Annotations.Items.Add(ser1HighPoint);
Constructors
ChartSeriesAnnotation()
Empty constructor for ChartSeriesAnnotation
Declaration
public ChartSeriesAnnotation()
Fields
AnnotationShapeProperty
Identifies the Annotation shapes
Declaration
public static readonly DependencyProperty AnnotationShapeProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
DescriptionProperty
Identifies the Description dependency property.
Declaration
public static readonly DependencyProperty DescriptionProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
FillProperty
Identifies the Fill dependency property
Declaration
public static readonly DependencyProperty FillProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
IsAnnotationDragDropProperty
Identifies the IsAnnotationDragDrop dependency property.
Declaration
public static readonly DependencyProperty IsAnnotationDragDropProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
OffsetXProperty
Identifies the OffsetX dependency property.
Declaration
public static readonly DependencyProperty OffsetXProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
OffsetYProperty
Identifies the OffsetY dependency property.
Declaration
public static readonly DependencyProperty OffsetYProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
StrokeProperty
Identifies the Stroke Dependency property
Declaration
public static readonly DependencyProperty StrokeProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
TemplateProperty
Identifies the Template dependency property.
Declaration
public static readonly DependencyProperty TemplateProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
XProperty
Identifies the X dependency property.
Declaration
public static readonly DependencyProperty XProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
YProperty
Identifies the Y dependency property.
Declaration
public static readonly DependencyProperty YProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Properties
AnnotationShape
Gets or sets the annotation shape.
Declaration
public AnnotationShapes AnnotationShape { get; set; }
Property Value
Type | Description |
---|---|
AnnotationShapes | The annotation shape. |
Description
Gets or sets the Description. This is a dependency property.
Declaration
public string Description { get; set; }
Property Value
Type | Description |
---|---|
System.String | The Description. |
Fill
Gets or sets the fill.
Declaration
public Brush Fill { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Media.Brush | The fill. |
IsAnnotationDragDrop
Gets or sets the IsAnnotationDragDrop.
Declaration
public bool IsAnnotationDragDrop { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The IsAnnotationDragDrop. |
OffsetX
Gets or sets the OffsetX. This is a dependency property.
Declaration
public double OffsetX { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The OffsetX. |
OffsetY
Gets or sets the OffsetY. This is a dependency property.
Declaration
public double OffsetY { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The OffsetY. |
Stroke
Gets or sets the stroke.
Declaration
public Brush Stroke { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Media.Brush | The stroke. |
Template
Gets or sets the Annotation Template. This is a dependency property.
Declaration
public DataTemplate Template { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.DataTemplate | The Template. |
X
Gets or sets the X. This is a dependency property.
Declaration
public double X { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The X value. |
Y
Gets or sets the Y. This is a dependency property.
Declaration
public double Y { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The Y value. |
Methods
Deserialize(String)
Method declaration for DeSerialize
Declaration
public object Deserialize(string xamlString)
Parameters
Type | Name | Description |
---|---|---|
System.String | xamlString |
Returns
Type |
---|
System.Object |
OnPropertyChanged(DependencyPropertyChangedEventArgs)
Invoked whenever the effective value of any dependency property on this System.Windows.DependencyObject has been updated. The specific dependency property that changed is reported in the event data.
Declaration
protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyPropertyChangedEventArgs | e | Event data that will contain the dependency property identifier of interest, the property metadata for the type, and old and new values. |
Serialize()
Method declaration for Serialize
Declaration
public string Serialize()
Returns
Type |
---|
System.String |
Events
PropertyChanged
Occurs when any property value changes.
Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Type
Type |
---|
System.ComponentModel.PropertyChangedEventHandler |