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



I am using the BrushAnnotation and it works fine except that the
mouseover events seems to happen too soon.
I mean that when the mouse is close to the BrushAnnotation, but not on it,
the mouse cursor changed and I can drag the BrushAnnotation.
It happens for all lines but especially for shapes with many segments which
are closed to each other, see attached file ‘MouseOver event too soon (my application).png’.
I saw something similar in your ‘Trade Annotation’ example ,
it happens when I used the Tools=>Pointer, see attached figure ‘MouseOver event too soon (from Scichart example).png’.
Can I changed the distance from which the mouseover event starts?

Best regards,

  • You must to post comments

Hi Eyal,

There is a reason why the annotation has a thicker hit-test area, so that it can be easily clicked on. However, if this is too large it can be adjusted by setting a property.

The ControlTemplate for BrushAnnotation looks like this

<ControlTemplate x:Key="BrushAnnotationTemplate" TargetType="{x:Type tradingAnnotations:BrushAnnotation}">

    <Grid x:Name="PART_LineAnnotationRoot">
            StrokeThickness="{x:Static s:ManipulationMargins.AnnotationLineWidth}" />
            Opacity="{TemplateBinding Opacity}"
            Stroke="{TemplateBinding Stroke}"
            StrokeThickness="{TemplateBinding StrokeThickness}" />


You will notice the GhostPolyLine has a StrokeThickness equal to static property ManipulationMargins.AnnotationLineWidth. Setting this property in code will reduce the hit-test size of all annotations, e.g.

 ManipulationMargins.AnnotationLineWidth = 3;

Let me know if this helps,

Best regards,

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.