Pre loader

Crosshair (CursorModifier) color and thickness

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

Answered
1
0

How to set Crosshair (CursorModifier) color and thickness in xaml?

  • You must to post comments
Best Answer
2
0

Hi there,

That appears to be the default behavior of WPF lines. To change it, you should set SnapsToDevicePixels to “True” and RenderOptions.EdgeMode to “Aliased” on a line. For Cursor, you could do this in a style using Andrew’s suggestion above:

                <Style TargetType="Line">
                <Setter Property="StrokeThickness" Value="1" />
                <Setter Property="SnapsToDevicePixels" Value="True" />
                <Setter Property="RenderOptions.EdgeMode" Value="Aliased" />
            </Style>

Hope it helps!

Best regards,
Yuriy

  • You must to post comments
1
0

Hi there,

The following properties are available for styling the CursorModifier:

Changing the CursorModifier Line Style

If you simply want to change the line style, try this code:

<CursorModifier>
    <CursorModifier.LineOverlayStyle>
        <Style TargetType="Line">
            <!-- To set the stroke -->
            <Setter Property="Stroke" Value="Red"/>

            <!-- To set the StrokeThickness -->
            <Setter Property="StrokeThickness" Value="2"/>

            <!-- To set a dashed line, else leave this setter out for default -->
            <Setter Property="StrokeDashArray" Value="2 2"/>
        </Style
    </CursorModifier.LineOverlayStyle>
</CursorModifier>

Hope this helps!

Best regards,
Andrew

  • RTrade A
    Andrew, thank you. Actually I was trying to make crosshair thinner , but apparently default value is 1. But it's still twice thicker than gridline (2 pixels versus 1).
  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies