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



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?


  • You must to post comments

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.