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


I have enabled the cursor to get the coordinates of the mouse. The code is very straightforward – attachment CursorModifier.txt.

The result is show in screenshot CursorModifier.png

(1) How can I disable the x-axis cursor and show only y-axis coordinate values?
(2) According to the code, the font size should be 16pt and the background should be yellow. This is not the case (attachment CursorModifier.png). How can I control these properties?
(3) If I decide to keep x-axis cursor, how v]=can I display the custom content which will be based on the mapping between the current value of X and the array or strings, ex. round up 28.858819 -> 29 and display string[29].

  • You must to post comments


Thank you for your enquiry! Most of your questions can be answered by the CursorModifier Documentation.

It’s not possible to hide just the XAxis label (and not the Y) but it is possible to change the FontSize and the decimal places and color of the Axis Labels as follows. See the section titled Styling the Axis Labels.

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.

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


Let me know if this helps,

Best regards,

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.