SciChartĀ® the market leader in Fast WPF Charts, WPF 3D Charts, and iOS Chart & Android Chart Components

Welcome to the SciChart Community Forums!

Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy. We also have a tag=SciChart on where you can earn rep for your questions!

Please note: SciChart team will only answer questions from customers with active support subscriptions. Expired support questions will be ignored. If your support status shows incorrectly, contact us and we will be glad to help.


I have a chart with a single XAxis (DateTimeAxis) and multiple YAxis (NumericAxis). I added two VerticalLineAnnotation with binding to their X1 and set the IsEditable to True. When I drag one of the annotations, I get an exception (See Attached Images).

The data series are not defined in the XAML. The chart’s SeriesSource is bound to a ObservableCollection, which I add series into in C#. I dragged the annotation AFTER the chart had drawn some series.

What am I doing wrong? šŸ™

I am using SciChart WPF v3.61.0.7847

    <s:DateTimeAxis DrawMinorGridLines="True" DrawMinorTicks="True" />

    <s:VerticalLineAnnotation IsEditable="True" VerticalAlignment="Stretch" ShowLabel="True" Stroke="Orange" StrokeThickness="2" X1="{Binding M1Value}"/>
    <s:VerticalLineAnnotation IsEditable="True" VerticalAlignment="Stretch" ShowLabel="True" Stroke="Orange" StrokeThickness="2" X1="{Binding M2Value}"/>

    private DateTime __M1Value;
    public DateTime M1Value
        get { return __M1Value; }
            __M1Value = value;

    private DateTime __M2Value;
    public DateTime M2Value
        get { return __M2Value; }
            __M2Value = value;
  • You must to post comments
Good Answer

I figured out what is needed.

Because I am using multiple YAxes, there is no default YAxis (null). For some reason, the VerticalLineAnnotation needs to know its Y coordinate even if it is a “stretch” line.

So the fix was just adding
to the XAML block for the VerticalLineAnnotation.

It would’ve been nice if the software was smart enough to figure that it didn’t need to know Y coordinates because it is a vertical line that stretched all the way. Oh well, at least it’s an easy workaround.

  • slake
    Hi there, yes, that is correct, in multiple YAxis scenarios, VerticalLineAnnotation does need to know the YAxis ID. This is because YAxes may be configured in a way so that they do not take up all the vertical space. Apologies our software didn’t warn you more clearly, but as you say the workaround is very simple. Thanks for posting the answer!
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.