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


If I set AutoRange = “Always” myHorizontalLineAnnotation draws fine. When I set it to “Never” – which I want – my HorizontalLineAnnotation won’t draw. How do I do this? ty

        <s:NumericAxis AutoRange="Never"
                       VisibleRange="{Binding ElementName=this, Path=YMinMax}"

        <s:HorizontalLineAnnotation HorizontalAlignment="Stretch"
                                    Y1="{Binding ElementName=this, Path=CurrentHigh}"
                                    Stroke="{Binding ElementName=this, Path=ToleranceColor}"
                                    StrokeThickness="1" />
  • Paul Richardson
    The HorizontalLineAnnotation is well within the range I am setting manually.
  • You must to post comments

Hi Paul,

I’m afraid I can’t reproduce this. In the ‘Annotations are Easy‘ example, I set the YAxis.AutoRange to Never. All the annotations appeared as expected.

The only thing I can think of is your VisibleRange binding is failing, or providing an invalid range. This would mean the chart has no range to display and hence no annotations will display.

Best regards,

  • You must to post comments

Thanks Andrew… I eliminated binding and range as the issue I think…

If I set AutoRange to Auto all is fine but not what I want, if I set AutoRange to Once – I have lines but then my binding will not update range properly. If I set it to Never binding works as expected but no Horizontal Lines… I’m not making any other code changes here just changing the AutoRange property.

I worked around this by manually drawing the lines from code and leaving AutoRange set to never.

If I ever figure it out I’ll post back.

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.