Pre loader

Adding Multiple Horizontal Line Annotations

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

0
0

Hello,

I need help in adding multiple Horizontal Line Annotations to my chart.

My chart has multiple data series and hence the need for multiple annotations. I have the following code but it does not seem to work.

Not even one Annotation gets displayed.

Please help !

<s:SciChartSurface RenderableSeries="{Binding ChartRenderableSeries}" Annotations="{Binding ThresholdCollection}" >
            <s:SciChartSurface.XAxis>
                <s:DateTimeAxis  AxisTitle="Time" VisibleRange="{Binding Settings.XVisibleRange, Mode=TwoWay}" />
            </s:SciChartSurface.XAxis>
            <s:SciChartSurface.YAxis>
                <s:NumericAxis AxisTitle="Values" VisibleRange="-30,30" AutoRange="Always"/>
            </s:SciChartSurface.YAxis>



public ObservableCollection<HorizontalLineAnnotation> ThresholdCollection { get; set; }

Every time user adds a Threshold, the following code gets executed.

var threshholdObj = new HorizontalLineAnnotation
            {
                Name="Threshold" ,
                Y1 = 2,
                Stroke= System.Windows.Media.Brushes.Blue
            };
            ThresholdCollection.Add(threshholdObj);
Version
v3.5.0.7128
  • You must to post comments
0
0

Hi Parvez,

Try setting HorizontalLineAnnotation properties as per our example ‘Annotations are Easy‘. Does this cause the annotation to show?

     <s:HorizontalLineAnnotation HorizontalAlignment="Stretch"
                                        FontSize="12"
                                        FontWeight="Bold"
                                        LabelPlacement="Axis"
                                        ShowLabel="True"
                                        Stroke="Orange"
                                        StrokeThickness="2"
                                        Y1="2" />

Best regards,
Andrew

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies