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

Welcome to the SciChart Community Forums!

Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy

We also have a tag=SciChart on where you can earn rep for your questions!


I have built a file availability chart displaying point markers for dates. The marker is being displayed on the left-most edge for each category. The effect is that when the user hovers directly over a marker it will often shown the wrong date in the mouse over label. Is there a way to center the point marker alignment with the category axis?

I’m using WPF version 3.4

  • You must to post comments

I think this is a rounding issue. The marker itself is centered on the X,Y point that you display, but the cursor won’t snap to the middle of the point so as you move the cursor over the point itself, there is some ‘give’ in the values it displays.

You may be able to force rounding to the nearest day by using a Converter inside an Axis Label Template, e.g. from our Documentation:

CursorModifier Axis Labels come with a default style. This style can be overridden by setting the CursorModifier.AxisLabelContainerStyle and/or CursorModifier.AxisLabelTemplate attached properties on the relevant axis.
For example:

<!-- Demonstrates custom cursor axis label style --> 
      <!-- This is the style for the control that hosts the Axis Label --> 
      <Style x:Key="CursorModAxisLabelStyle" TargetType="s:AxisLabelControl">
         <Setter Property="Background" Value="#AAFF6600" />
         <Setter Property="BorderBrush" Value="#FFFF6600" />
         <Setter Property="BorderThickness" Value="1" />

      <!-- This is the DataTemplate for the Axis Label. DataContext is AxisInfo -->
      <DataTemplate x:Key="CursorModAxisLabelTemplate" DataType="s:AxisInfo">
            <TextBlock Foreground="White" FontFamily="Arial" FontSize="11" Margin="2"
                       Text="{Binding DataValue, StringFormat='{}{0:0.00}'}" />

   <!--  Declare Axes with CursorLabelTemplates -->
      <s:NumericAxis s:CursorModifier.AxisLabelContainerStyle="{StaticResource CursorModAxisLabelStyle}" 
                     s:CursorModifier.AxisLabelTemplate="{StaticResource CursorModAxisLabelTemplate}" />

      <s:NumericAxis s:CursorModifier.AxisLabelContainerStyle="{StaticResource CursorModAxisLabelStyle}" 
                     s:CursorModifier.AxisLabelTemplate="{StaticResource CursorModAxisLabelTemplate}" />

         <s:CursorModifier ShowAxisLabels="true"/>


There’s a StringFormat in the CursorModAxisLabelTemplate but you could easily replace this for a Converter which rounds to the nearest date.

Let me know if this helps,

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.