Pre loader

Tag: multiple 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 votes
11k views

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);
Showing 1 result

Try SciChart Today

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

Start TrialCase Studies