WPF Charting Documentation - SciChart WPF Charts SDK v5.x
LineAnnotation Class
Members  Example 
Defines a read-only or editable Line annotation, which may be placed on the chart at specific X1,Y1,X2,Y2 coordinates
Object Model
LineAnnotation ClassIAnnotationCanvas InterfaceIAnnotationCanvas InterfaceIChartModifierSurface InterfaceAnnotationBase ClassIAnnotationCanvas InterfaceIAnnotationCanvas InterfaceIChartModifierSurface InterfaceAnnotationBase ClassISciChartSurface InterfaceIMainGrid InterfaceAnnotationCoordinates StructureIServiceContainer InterfaceIAxis InterfaceIAxis InterfaceISciChartSurface InterfaceIAnnotationCanvas InterfaceAnnotationCollection ClassIAnnotation InterfaceIAnnotationCanvas InterfaceIChartModifier InterfaceIGridLinesPanel InterfaceIChartModifierSurface InterfaceIRenderSurface InterfaceIMainGrid InterfaceIServiceContainer InterfaceIViewportManager InterfaceAxisCollection ClassIAxis InterfaceIAxis InterfaceAxisCollection ClassIAxis InterfaceIAxis InterfaceIZoomHistoryManager InterfaceIMainGrid InterfaceAnnotationCoordinates StructureIServiceContainer InterfaceIAxis InterfaceIRange InterfaceIRange InterfaceILabelProvider InterfaceIAnnotationCanvas InterfaceISciChartSurfaceBase InterfaceIServiceContainer InterfaceITickProvider InterfaceIRange InterfaceIRange InterfaceIAxis InterfaceIRange InterfaceIRange InterfaceILabelProvider InterfaceIAnnotationCanvas InterfaceISciChartSurfaceBase InterfaceIServiceContainer InterfaceITickProvider InterfaceIRange InterfaceIRange Interface
Syntax
[AbtLicenseProvider()]
[TemplatePart(Name="PART_GhostLine", Type=System.Windows.Shapes.Line)]
[TemplatePart(Name="PART_LineAnnotationRoot", Type=System.Windows.Controls.Grid)]
[TemplatePart(Name="PART_Line", Type=System.Windows.Shapes.Line)]
public class LineAnnotation : LineAnnotationBase, IAnnotation, SciChart.Core.Framework.IHitTestable, SciChart.Core.Framework.ISuspendable  
Example
Shows how to create and add a LineAnnotation to a SciChartSurface in XAMLShows how to create and add a LineAnnotation to a SciChartSurface in Code
<!-- where xmlns:s="http://schemas.abtsoftware.co.uk/scichart"-->
<s:SciChartSurface>
   <!-- RenderableSeries omitted for brevity -->
            
   <s:SciChartSurface.XAxis>
      <s:NumericAxis Id="DefaultAxisId"/>
   </s:SciChartSurface.XAxis> 
   <s:SciChartSurface.YAxis>
      <s:NumericAxis Id="DefaultAxisId"/>
   </s:SciChartSurface.YAxis>
            
   <s:SciChartSurface.Annotations>
      <!-- Declare a LineAnnotation at X1,X2,Y1,Y2 -->
      <!-- NOTE: XAxisId and YAxisId are optional if you use default Ids on a single X,Y Axis -->
      <s:LineAnnotation X1="1" X2="2" Y1="3" Y2="4" 
                        Stroke="Orange" StrokeThickness="2" StrokeDashArray="2 2"
                        AnnotationCanvas="AboveChart"
                        IsSelected="False"
                        IsEditable="False"
                        XAxisId="DefaultAxisId"
                        YAxisId="DefaultAxisId" />
   </s:SciChartSurface.Annotations>
</s:SciChartSurface>
var sciChartSurface = new SciChartSurface();
sciChartSurface.XAxis = new NumericAxis() { Id = "DefaultAxisId" };
sciChartSurface.YAxis = new NumericAxis() { Id = "DefaultAxisId" };
            
// Declare a LineAnnotation at X1,X2,Y1,Y2
// NOTE: XAxisId and YAxisId are optional if you use default Ids on a single X,Y Axis
sciChartSurface.Annotations.Add(new LineAnnotation() 
{
   X1 = 1, X2 = 2, Y1 = 3, Y2 = 4, 
   Stroke = new SolidColorBrush(Colors.Orange), 
   StrokeThickness = 2, 
   StrokeDashArray = new DoubleCollection(new double[] { 2, 2 }),
   AnnotationCanvas = AnnotationCanvas.AboveChart, 
   IsSelected = false, 
   IsEditable = false, 
   XAxisId = "DefaultAxisId", 
   YAxisId = "DefaultAxisId",
});
Inheritance Hierarchy

System.Object
   System.Windows.Threading.DispatcherObject
      System.Windows.DependencyObject
         System.Windows.Media.Visual
            System.Windows.UIElement
               System.Windows.FrameworkElement
                  System.Windows.Controls.Control
                     System.Windows.Controls.ContentControl
                        SciChart.Charting.ChartModifiers.ApiElementBase
                           SciChart.Charting.Visuals.Annotations.AnnotationBase
                              SciChart.Charting.Visuals.Annotations.LineAnnotationBase
                                 SciChart.Charting.Visuals.Annotations.LineAnnotation
                                    SciChart.Charting.DrawingTools.TradingAnnotations.ExtendedLineAnnotation
                                    SciChart.Charting.DrawingTools.TradingAnnotations.FibonacciAnnotation.FibonacciRatioLineBase
                                    SciChart.Charting.Visuals.Annotations.CustomLineAnnotation
                                    SciChart.Charting.Visuals.Annotations.LineAnnotationForMvvm
                                    SciChart.Charting.Visuals.Annotations.LineAnnotationWithLabelsBase
                                    SciChart.Charting.Visuals.Annotations.TrendLineAnnotationBase

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

Reference

LineAnnotation Members
SciChart.Charting.Visuals.Annotations Namespace

 

 


SCICHART ® is a Registered Trademark in the UK, US and EU. Copyright SciChart Ltd 2011-2018.

Send Feedback