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)?
- Alex Lynch asked 14 years ago
- You must login to post comments
UPDATE: Using Annotations feature (v1.5 and greater).
Using the Annotations API 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>
The zero line is added using a HorizontalLineAnnotation. This is simply placed at Y1=0 and stretched to the width of the chart using HorizontalAlignment.Stretch.
- Andrew Burnett-Thompson answered 14 years ago
- last edited 1 year ago
- You must login to post comments
Please login first to submit.

