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

0
0

Hello,

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,
Eyal

Version
6.2.1.13304
Images
  • You must to post comments
0
0

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">
        <Polyline
            x:Name="PART_GhostPolyLine"
            Stroke="Transparent"
            StrokeThickness="{x:Static s:ManipulationMargins.AnnotationLineWidth}" />
        <Polyline
            x:Name="PART_Polyline"
            Opacity="{TemplateBinding Opacity}"
            Stroke="{TemplateBinding Stroke}"
            StrokeThickness="{TemplateBinding StrokeThickness}" />
    </Grid>

</ControlTemplate>

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,
Andrew

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.