Class Annotation
Provides a lightweight control for displaying overlay element in SfChart.
Implements
Namespace: Syncfusion.UI.Xaml.Charts
Assembly: Syncfusion.SfChart.UWP.dll
Syntax
public abstract class Annotation : FrameworkElement, ICloneable
Constructors
Annotation()
Initializes a new instance of the Annotation class.
Declaration
public Annotation()
Fields
ContentTemplateProperty
The DependencyProperty for ContentTemplate property.
Declaration
public static readonly DependencyProperty ContentTemplateProperty
Field Value
Type |
---|
Windows.UI.Xaml.DependencyProperty |
CoordinateUnitProperty
The DependencyProperty for CoordinateUnit property.
Declaration
public static readonly DependencyProperty CoordinateUnitProperty
Field Value
Type |
---|
Windows.UI.Xaml.DependencyProperty |
EnableClippingProperty
The DependencyProperty for EnableClipping property.
Declaration
public static readonly DependencyProperty EnableClippingProperty
Field Value
Type |
---|
Windows.UI.Xaml.DependencyProperty |
EnableEditingProperty
The DependencyProperty for EnableEditing property.
Declaration
public static readonly DependencyProperty EnableEditingProperty
Field Value
Type |
---|
Windows.UI.Xaml.DependencyProperty |
FontFamilyProperty
The DependencyProperty for FontFamily property.
Declaration
public static readonly DependencyProperty FontFamilyProperty
Field Value
Type |
---|
Windows.UI.Xaml.DependencyProperty |
FontSizeProperty
The DependencyProperty for FontSize property.
Declaration
public static readonly DependencyProperty FontSizeProperty
Field Value
Type |
---|
Windows.UI.Xaml.DependencyProperty |
FontStretchProperty
The DependencyProperty for FontStretch property.
Declaration
public static readonly DependencyProperty FontStretchProperty
Field Value
Type |
---|
Windows.UI.Xaml.DependencyProperty |
FontStyleProperty
The DependencyProperty for FontStyle property.
Declaration
public static readonly DependencyProperty FontStyleProperty
Field Value
Type |
---|
Windows.UI.Xaml.DependencyProperty |
FontWeightProperty
The DependencyProperty for FontWeight property.
Declaration
public static readonly DependencyProperty FontWeightProperty
Field Value
Type |
---|
Windows.UI.Xaml.DependencyProperty |
ForegroundProperty
The DependencyProperty for Foreground property.
Declaration
public static readonly DependencyProperty ForegroundProperty
Field Value
Type |
---|
Windows.UI.Xaml.DependencyProperty |
ShowToolTipProperty
The DependencyProperty for ShowToolTip property.
Declaration
public static readonly DependencyProperty ShowToolTipProperty
Field Value
Type |
---|
Windows.UI.Xaml.DependencyProperty |
TextProperty
The DependencyProperty for Text property.
Declaration
public static readonly DependencyProperty TextProperty
Field Value
Type |
---|
Windows.UI.Xaml.DependencyProperty |
ToolTipContentProperty
The DependencyProperty for ToolTipContent property.
Declaration
public static readonly DependencyProperty ToolTipContentProperty
Field Value
Type |
---|
Windows.UI.Xaml.DependencyProperty |
ToolTipPlacementProperty
The DependencyProperty for ToolTipPlacement property.
Declaration
public static readonly DependencyProperty ToolTipPlacementProperty
Field Value
Type |
---|
Windows.UI.Xaml.DependencyProperty |
ToolTipShowDurationProperty
The DependencyProperty for ToolTipShowDuration property.
Declaration
public static readonly DependencyProperty ToolTipShowDurationProperty
Field Value
Type |
---|
Windows.UI.Xaml.DependencyProperty |
ToolTipTemplateProperty
The DependencyProperty for ToolTipTemplate property.
Declaration
public static readonly DependencyProperty ToolTipTemplateProperty
Field Value
Type |
---|
Windows.UI.Xaml.DependencyProperty |
X1Property
The DependencyProperty for X1 property.
Declaration
public static readonly DependencyProperty X1Property
Field Value
Type |
---|
Windows.UI.Xaml.DependencyProperty |
XAxisNameProperty
The DependencyProperty for XAxisName property.
Declaration
public static readonly DependencyProperty XAxisNameProperty
Field Value
Type |
---|
Windows.UI.Xaml.DependencyProperty |
Y1Property
The DependencyProperty for Y1 property.
Declaration
public static readonly DependencyProperty Y1Property
Field Value
Type |
---|
Windows.UI.Xaml.DependencyProperty |
YAxisNameProperty
The DependencyProperty for XAxisName property.
Declaration
public static readonly DependencyProperty YAxisNameProperty
Field Value
Type |
---|
Windows.UI.Xaml.DependencyProperty |
Properties
AnnotationElement
Gets or sets the annotation grid.
Declaration
protected Grid AnnotationElement { get; set; }
Property Value
Type |
---|
Windows.UI.Xaml.Controls.Grid |
ContentTemplate
Gets or sets the custom template for Text.
Declaration
public DataTemplate ContentTemplate { get; set; }
Property Value
Type | Description |
---|---|
Windows.UI.Xaml.DataTemplate | This accepts a DataTemplate. Windows.UI.Xaml.DataTemplate |
Examples
<syncfusion:SfChart.Annotations>
<syncfusion:Annotation ContentTemplate="{StaticResource contentTemplate}">
</syncfusion:SfChart.Annotations>
annotation.ContentTemplate = dataTemplate;
CoordinateUnit
Gets or sets the property which identifies whether the annotation positioned w.r.t pixel or axis coordinate.
Declaration
public CoordinateUnit CoordinateUnit { get; set; }
Property Value
Type | Description |
---|---|
CoordinateUnit | - position the annotation based on screen coordinates.
- position the annotation based on axis values.
|
EnableClipping
Gets or sets a value indicating whether annotation should clip while crossing with boundary.
Declaration
public bool EnableClipping { get; set; }
Property Value
Type |
---|
System.Boolean |
EnableEditing
Gets or sets a value indicating whether the text in TextAnnotation
can be edited or not.
Declaration
public bool EnableEditing { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
FontFamily
Gets or sets the font family for the annotation description.
Declaration
public FontFamily FontFamily { get; set; }
Property Value
Type | Description |
---|---|
Windows.UI.Xaml.Media.FontFamily | This accepts all the FontFamily. |
FontSize
Gets or sets the font size of the annotation description.
Declaration
public double FontSize { get; set; }
Property Value
Type | Description |
---|---|
System.Double | It accepts the double value. |
FontStretch
Gets or sets the font stretch for the annotation description.
Declaration
public FontStretch FontStretch { get; set; }
Property Value
Type | Description |
---|---|
Windows.UI.Text.FontStretch | This property of type Windows.UI.Text.FontStretch. |
FontStyle
Gets or sets the font style for the annotation description.
Declaration
public FontStyle FontStyle { get; set; }
Property Value
Type | Description |
---|---|
Windows.UI.Text.FontStyle | This property of type Windows.UI.Text.FontStyle. |
FontWeight
Gets or sets the font weight for the annotation description.
Declaration
public FontWeight FontWeight { get; set; }
Property Value
Type | Description |
---|---|
Windows.UI.Text.FontWeight | This property of type Windows.UI.Text.FontWeight property. |
Foreground
Gets or sets the foreground for the annotation description.
Declaration
public Brush Foreground { get; set; }
Property Value
Type | Description |
---|---|
Windows.UI.Xaml.Media.Brush | The Windows.UI.Xaml.Media.Brush value. |
IsUiCleared
Gets or sets a value indicating whether the UI is cleared.
Declaration
protected bool IsUiCleared { get; set; }
Property Value
Type |
---|
System.Boolean |
RotatedTextRect
Gets or sets the rotated Windows.Foundation.Rect of the annotations.
Declaration
protected Rect RotatedTextRect { get; set; }
Property Value
Type |
---|
Windows.Foundation.Rect |
ShowToolTip
Gets or sets a value indicating whether ToolTip
can be displayed in Annotation.
Declaration
public bool ShowToolTip { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The |
Text
Gets or sets the description text for Annotation.
Declaration
public string Text { get; set; }
Property Value
Type |
---|
System.String |
TextElement
Gets or sets the text element.
Declaration
protected ContentControl TextElement { get; set; }
Property Value
Type |
---|
Windows.UI.Xaml.Controls.ContentControl |
TextElementCanvas
Gets or sets the text element canvas.
Declaration
protected Canvas TextElementCanvas { get; set; }
Property Value
Type |
---|
Windows.UI.Xaml.Controls.Canvas |
ToolTipContent
Gets or sets the content to be displayed in annotation tooltip.
Declaration
public object ToolTipContent { get; set; }
Property Value
Type | Description |
---|---|
System.Object | This accepts all arbitrary .net objects. |
ToolTipPlacement
Gets or sets the position of the ToolTip.
Declaration
public ToolTipLabelPlacement ToolTipPlacement { get; set; }
Property Value
Type | Description |
---|---|
ToolTipLabelPlacement | will place the ToolTip left.
will place the ToolTip right.
will place the ToolTip top.
will place the ToolTip bottom.
|
ToolTipShowDuration
Gets or sets the elapse time for the ToolTip.
Declaration
public double ToolTipShowDuration { get; set; }
Property Value
Type | Description |
---|---|
System.Double | It accepts the |
ToolTipTemplate
Gets or sets the custom template for the ToolTip.
Declaration
public DataTemplate ToolTipTemplate { get; set; }
Property Value
Type | Description |
---|---|
Windows.UI.Xaml.DataTemplate | This accepts the DataTemplate. Windows.UI.Xaml.DataTemplate |
Examples
<syncfusion:SfChart.Annotations>
<syncfusion:Annotation ShowToolTip="true" ToolTipTemplate="{StaticResource toolTipTemplate}">
</syncfusion:SfChart.Annotations>
annotation.ShowToolTip = true;
annotation.ToolTipTemplate = dataTemplate;
x1
Declaration
protected double x1 { get; set; }
Property Value
Type |
---|
System.Double |
X1
Gets or sets the x 1 value.
Declaration
public object X1 { get; set; }
Property Value
Type |
---|
System.Object |
XAxisName
Gets or sets the axis(horizontal) in which this annotation associated.
Declaration
public string XAxisName { get; set; }
Property Value
Type |
---|
System.String |
Remarks
This property works only with CoordinateUnit as CoordinateUnit.Axis
.
y1
Declaration
protected double y1 { get; set; }
Property Value
Type |
---|
System.Double |
Y1
Gets or sets the y 1 value.
Declaration
public object Y1 { get; set; }
Property Value
Type |
---|
System.Object |
YAxisName
Gets or sets the axis(vertical) in which this annotation associated.
Declaration
public string YAxisName { get; set; }
Property Value
Type |
---|
System.String |
Remarks
This property works only with CoordinateUnit as CoordinateUnit.Axis
.
Methods
CanUpdateRange(Object, Object)
Checks for the update requirement.
Declaration
protected bool CanUpdateRange(object x, object y)
Parameters
Type | Name | Description |
---|---|---|
System.Object | x | The x value. |
System.Object | y | The y value. |
Returns
Type | Description |
---|---|
System.Boolean | Returns the value indicating whether the range update required. |
Clone()
Returns the clone annotation
Declaration
public DependencyObject Clone()
Returns
Type | Description |
---|---|
Windows.UI.Xaml.DependencyObject | Returns the cloned annotation. |
CloneAnnotation(Annotation)
Clones the annotation.
Declaration
protected virtual DependencyObject CloneAnnotation(Annotation annotation)
Parameters
Type | Name | Description |
---|---|---|
Annotation | annotation | The annotation cloned is updated. |
Returns
Type | Description |
---|---|
Windows.UI.Xaml.DependencyObject | Returns the cloned annotation. |
EnsurePoint(Point, Point)
Calculates the ensure point.
Declaration
protected Point EnsurePoint(Point point1, Point point2)
Parameters
Type | Name | Description |
---|---|---|
Windows.Foundation.Point | point1 | The first point |
Windows.Foundation.Point | point2 | The second point |
Returns
Type | Description |
---|---|
Windows.Foundation.Point | Returns the ensure point. |
GetClippingValues(Double, ChartAxis)
This method is used to modify the value for clipping out of axis
Declaration
protected double GetClippingValues(double value, ChartAxis axis)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | The value to be checked in clipping range. |
ChartAxis | axis | The axis to get the visible range. |
Returns
Type | Description |
---|---|
System.Double | Returns the clipped values. |
GetElementPosition(Size, Point)
Gets the element position.
Declaration
protected Point GetElementPosition(Size desiredSize, Point originalPosition)
Parameters
Type | Name | Description |
---|---|---|
Windows.Foundation.Size | desiredSize | The desired size to get alignment position. |
Windows.Foundation.Point | originalPosition | The original position. |
Returns
Type | Description |
---|---|
Windows.Foundation.Point | Returns the element position. |
GetElementPosition(FrameworkElement, Point)
Gets the element position.
Declaration
protected Point GetElementPosition(FrameworkElement element, Point originalPosition)
Parameters
Type | Name | Description |
---|---|---|
Windows.UI.Xaml.FrameworkElement | element | The annotation Windows.UI.Xaml.FrameworkElement. |
Windows.Foundation.Point | originalPosition | The original position. |
Returns
Type | Description |
---|---|
Windows.Foundation.Point | Returns the element position. |
GetRenderedAnnotation()
Gets the rendered annotation.
Declaration
public virtual UIElement GetRenderedAnnotation()
Returns
Type | Description |
---|---|
Windows.UI.Xaml.UIElement | A UI Element |
GetRotatePoint(Double, FrameworkElement, Point)
Gets the rotated points.
Declaration
protected Point GetRotatePoint(double angle, FrameworkElement item, Point originalPoint)
Parameters
Type | Name | Description |
---|---|---|
System.Double | angle | The specified angle. |
Windows.UI.Xaml.FrameworkElement | item | The Windows.UI.Xaml.FrameworkElement. |
Windows.Foundation.Point | originalPoint | The original point. |
Returns
Type | Description |
---|---|
Windows.Foundation.Point | Returns the matrix transformed. |
IntersectsWith(Rect, Rect)
Checks whether the given two Windows.Foundation.Rect intersects.
Declaration
protected bool IntersectsWith(Rect r1, Rect r2)
Parameters
Type | Name | Description |
---|---|---|
Windows.Foundation.Rect | r1 | The first Windows.Foundation.Rect |
Windows.Foundation.Rect | r2 | The second Windows.Foundation.Rect |
Returns
Type | Description |
---|---|
System.Boolean | Returns a System.Boolean value indicating whether the two Windows.Foundation.Rect are intersecting. |
OnSelected(EventArgs)
Invoked when an unhandled Selected event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Declaration
protected virtual void OnSelected(EventArgs args)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | args | The System.EventArgs that contains the event data. |
OnUnSelected(EventArgs)
Invoked when an unhandled UnSelected event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Declaration
protected virtual void OnUnSelected(EventArgs args)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | args | The System.EventArgs that contains the event data. |
RotateElement(Double, FrameworkElement)
Rotates the element to the specified angle.
Declaration
protected Rect RotateElement(double angle, FrameworkElement item)
Parameters
Type | Name | Description |
---|---|---|
System.Double | angle | The angle specified for rotation. |
Windows.UI.Xaml.FrameworkElement | item | The Windows.UI.Xaml.FrameworkElement. |
Returns
Type | Description |
---|---|
Windows.Foundation.Rect | Returns the transformed element. |
RotateElement(Double, FrameworkElement, Size)
Rotates the element to the specified angle.
Declaration
protected Rect RotateElement(double angle, FrameworkElement item, Size itemSize)
Parameters
Type | Name | Description |
---|---|---|
System.Double | angle | The angle specified for rotation. |
Windows.UI.Xaml.FrameworkElement | item | The Windows.UI.Xaml.FrameworkElement. |
Windows.Foundation.Size | itemSize | The Windows.UI.Xaml.FrameworkElement size. |
Returns
Type | Description |
---|---|
Windows.Foundation.Rect | Returns the transformed element. |
SetBindings()
Sets the annotation bindings to the required elements.
Declaration
protected virtual void SetBindings()
SetData()
Sets the required x and y values.
Declaration
protected void SetData()
UpdateAnnotation()
Updates the annotation.
Declaration
public virtual void UpdateAnnotation()
Events
PointerMoved
Occurs when a pointer moves while the pointer remains within the hit test area of this element.
Declaration
public event PointerEventHandler PointerMoved
Event Type
Type |
---|
Windows.UI.Xaml.Input.PointerEventHandler |
PointerPressed
Occurs when the pointer device initiates a Press action within this element.
Declaration
public event PointerEventHandler PointerPressed
Event Type
Type |
---|
Windows.UI.Xaml.Input.PointerEventHandler |
PointerReleased
Occurs when the pointer device that previously initiated a Press action is released, while within this element.
Declaration
public event PointerEventHandler PointerReleased
Event Type
Type |
---|
Windows.UI.Xaml.Input.PointerEventHandler |
Selected
Occurs when Annotation becomes selected.
Declaration
public event EventHandler Selected
Event Type
Type |
---|
System.EventHandler |
UnSelected
Occurs when Annotation becomes unselected.
Declaration
public event EventHandler UnSelected
Event Type
Type |
---|
System.EventHandler |