Pre loader

Annotations become invisible for mouse click

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

0
0

Good day!
I have a problem with annotations. When I add them by double clicking on surface with this snippet of code:

private TextPointAnnotation LoadTextPointAnnotation(double x1, double y1)
        {
            var textPoint = new TextPointAnnotation
            {
                X1 = x1,
                Y1 = y1,
                ElementX2 = -10,
                ElementY2 = -5,
                ElementFontSize = 9,
                AnnotationName = "TXTAnnot" + _annotaionCount,
                ElementFontColor = Colors.Yellow,
                ElementWidth = 50,
                ElementHeight = 20,
                BorderBrush = new SolidColorBrush(Colors.Red),
                Background = new SolidColorBrush(Color.FromArgb(78, 255, 0, 0)),
                YAxisId = TextOfYAxis,
                IsHidden = !_isTextPointAnnotationsVisible,
                IsEditable = true,
                AnnotationCanvas = AnnotationCanvas.AboveChart,
                CanEditText = false
            };
            textPoint.ElementText = String.Format("{0}", textPoint.AnnotationName);
            textPoint.ContextMenu = BuildMenu(textPoint);
            textPoint.MouseMove += AnnotationMove;
            textPoint.MouseRightButtonDown += OnRightMouseAnnotationDown;
            textPoint.PreviewMouseLeftButtonDown += textPoint_PreviewMouseLeftButtonDown;
            textPoint.PreviewMouseMove += textPoint_PreviewMouseMove;
            AnnotationCollection.Add(textPoint);
            return textPoint;
        }

They are visible for mouse actions (for example, mouse move, mouse down and etc.)(Image 1)
But when I add them programmaticaly, for example in Loaded method- LoadTextPointAnnotation(100,200), they are not visible for mouse actions, that I’ve already mentioned above(Image 2).

What is the reason of strange behaviour?

Thanks in advance.

Images
  • You must to post comments
Showing 0 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