WPF Charting Documentation - SciChart WPF Charts SDK v5.x
SeriesValueModifier

The SeriesValueModifier displays the last series value (or latest series value in the viewport) as a marker on the YAxis. This modifier automatically creates one AxisMarkerAnnotation per RenderableSeries and places it at the series latest Y-Value.

Declaring a SeriesValueModifier in XAML

To declare a SeriesValueModifier, simply add it to the collection of ChartModifiers on the SciChartSurface:

Declaring a SeriesValueModifier
Copy Code
<!-- where xmlns:s="http://schemas.abtsoftware.co.uk/SciChart" -->
<s:SciChartSurface>

   <!-- XAxis, YAxis, RenderableSeries omitted for brevity -->
  
   <s:SciChartSurface.ChartModifier>
      <s:ModifierGroup>
            <s:SeriesValueModifier/>
         </s:ModifierGroup>
   </s:SciChartSurface.ChartModifier>
</s:SciChartSurface>

Declaring a SeriesValueModifier in Code

Declaring a SeriesValueModifier
Copy Code
// XAxis, YAxis, RenderableSeries omitted for brevity
var sciChartSurface = new SciChartSurface();
sciChartSurface.ChartModifier = new ModifierGroup(
  new SeriesValueModifier());

Excluding a Series from the SeriesValueModifier

By default, all RenderableSeries are included in the SeriesValueModifier and will have an axis marker. You can exclude a series by setting the attached property SeriesValueModifier.IncludeSeries = false on the RenderableSeries.

Excluding a Series from the SeriesValueModifier
Copy Code
<!-- where xmlns:s="http://schemas.abtsoftware.co.uk/SciChart" -->
<s:SciChartSurface>

   <!-- XAxis, YAxis, RenderableSeries omitted for brevity -->
  
   <s:SciChartSurface.RenderableSeries>
      <s:FastLineRenderableSeries s:SeriesValueModifier.IncludeSeries="False"/>
   </s:SciChartSurface.RenderableSeries>
  
   <s:SciChartSurface.ChartModifier>
      <s:ModifierGroup>
            <s:SeriesValueModifier/>
         </s:ModifierGroup>
   </s:SciChartSurface.ChartModifier>
</s:SciChartSurface>

Styling the SeriesValueModifier Axis Markers

To customize look of SeriesValueModifier, you could set any of the BorderBrush, Background, Foreground properties. Also you can define a Style and apply it to AxisMarkerStyle property:

Styling the SeriesValueModifier Axis Markers
Copy Code
<SeriesValueModifier.AxisMarkerStyle>
   <Style BasedOn="{StaticResource AxisMarkerAnnotationStyle}"
            TargetType="a:AxisMarkerAnnotation">
      <!--  Assumes data context is the RenderableSeries  -->
      <Setter Property="BorderBrush" Value="{Binding Background,
              RelativeSource={RelativeSource Self}}" />
      <Setter Property="Background" Value="{Binding Stroke, Converter={StaticResource
              ColorToBrushConverter}}" />
      <Setter Property="YAxisId" Value="{Binding YAxisId}" />
      <Setter Property="IsHidden" Value="{Binding
              Path=(c:SeriesValueModifier.IncludeSeries), Converter={StaticResource
              InvertBooleanConverter}}" />
   </Style>
</SeriesValueModifier.AxisMarkerStyle>

The Style is applied to the AxisMarkerAnnotation. You can also template the AxisMarkerAnnotation by following the guidelines in Templating the AxisMarkerAnnotation

 

 


SCICHART ® is a Registered Trademark in the UK, US and EEC. Copyright SciChart Ltd 2011-2018.

Email us to give feedback!