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


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

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:

    <!-- 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"/>

This technique is demonstrated in the Vertically Stacked Axis example.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.