Pre loader

How can I add a constant Zero Line on a chart

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

Answered
1
0

Our current graphs have an additional data series to highlight the 0, or break-even line. How can I do that using SciChart without adding a data series (which would be included in the rollover feedback)?

  • You must to post comments
Best Answer
1
0

UPDATE: Using Annotations feature (v1.5 and greater).

Using the Annotations Feature a zero line can be achieved with the following XAML on a chart:

<s:SciChartSurface.Annotations>
                
    <!-- Draws Bands behind an axis. Assumes there is a YAxis with ElementName myAxis -->
    <s:BoxAnnotation CoordinateMode="RelativeX" X1="0" X2="1" Y1="{Binding VisibleRange.Min, ElementName=myAxis}" Y2="{Binding VisibleRange.Max, ElementName= myAxis}" Background="#11000000" AnnotationCanvas="BelowChart"/>

    <!-- Draws the zero lines for an axis. Assumes AxisId of the YAxis is myAxisId -->
    <s:HorizontalLineAnnotation Y1="0" YAxisId="myAxisId" HorizontalAlignment="Stretch" StrokeThickness="1" AnnotationCanvas="BelowChart"/>
</s:SciChartSurface.Annotations>

This technique is demonstrated in the Vertically Stacked Axis example.

  • 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