Class ChartAnnotationLabel
Represents ChartLabel class used to set custom labels on Chart
Inheritance
Implements
Namespace: Syncfusion.Windows.Chart
Assembly: Syncfusion.Chart.Wpf.dll
Syntax
public class ChartAnnotationLabel : DependencyObject, IChartSerializer
Remarks
Chart for WPF also lets you add some annotations to the chart at specific control co-ordinates. By default, these annotations appear as simple text labels. But, their look and feel can be fully customized using custom templates.
Examples
XAML:
<syncfusion:Chart Name="chart1">
<!-- Template defining the custom look and feel of the annotations -->
<syncfusion:Chart.AnnotationLabelTemplate>
<DataTemplate>
<Border Background="MintCream" BorderBrush="Black"
BorderThickness="1">
<TextBlock Text="{Binding}" Foreground="Black"
FontFamily="Tahoma" FontSize="12" Margin="5"/>
</Border>
</DataTemplate>
</syncfusion:Chart.AnnotationLabelTemplate>
<syncfusion:Chart.AnnotationLabels>
<!-- ChartAnnotationLabel instance representing the location and
content of the annotation. -->
<syncfusion:ChartAnnotationLabel x:Name="label1" Content="Top 6
Products" OffsetX="50" OffsetY="60">
</syncfusion:ChartAnnotationLabel>
</syncfusion:Chart.AnnotationLabels>
</syncfusion:Chart>
Constructors
ChartAnnotationLabel()
Initializes a new instance of the ChartAnnotationLabel class.
Declaration
public ChartAnnotationLabel()
ChartAnnotationLabel(Double, Double)
Initializes a new instance of the ChartAnnotationLabel class.
Declaration
public ChartAnnotationLabel(double offsetX, double offsetY)
Parameters
Type | Name | Description |
---|---|---|
System.Double | offsetX | The offset X. |
System.Double | offsetY | The offset Y. |
Fields
AnnotationShapeProperty
Identifies the AnnotationShape dependency property.
Declaration
public static readonly DependencyProperty AnnotationShapeProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
ContentProperty
Identifies the Content dependency property.
Declaration
public static readonly DependencyProperty ContentProperty
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
Dependency property for check AnnotationDragDrop or not
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 |
TemplateProperty
Identifies the Template dependency property.
Declaration
public static readonly DependencyProperty TemplateProperty
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. |
Content
Gets or sets the content.
Declaration
public object Content { get; set; }
Property Value
Type | Description |
---|---|
System.Object | The content. |
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. |
Template
Gets or sets the template.
Declaration
public DataTemplate Template { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.DataTemplate | The template. |
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 |