Pre loader

Drag vertical line annotations by the label

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

Hi,

I have a VerticalLineAnnotation that can be dragged over the chart by clicking and dragging on the line itself. (See attached image). The problem is, whenever I put the chart in front of a user, they try to drag by clicking on the label (the blue label with the time in the image).

How can I make this label draggable like the line?

Thanks.

Images
  • You must to post comments
0
0

I found a solution – I create the AnnotationLabel in code and forward its mouse events to the VerticalLineAnnotation:

var line = new VerticalLineAnnotation();
var label = new AnnotationLabel {Cursor = Cursors.Hand};

label.MouseDown += (sender, args) => line.RaiseEvent(args);
label.MouseUp += (sender, args) => line.RaiseEvent(args);
label.MouseMove += (sender, args) => line.RaiseEvent(args);

line.AnnotationLabels = new ObservableCollection<AnnotationLabel> {label};
  • You must to post comments
Showing 1 result
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