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

Answered
0
0

Hi,

How can i listen annotation selection changes? I try this code but i’m getting error “Cannot assign to property: ‘lineAnnotation’ is immutable”

var lineAnnotation = SCILineAnnotation()
lineAnnotation.annotationSelectionChangedListener = { (annotation, isSelected) in
//
}

Tnx.

Version
3.1.0.5175
  • You must to post comments
Best Answer
2
0

Hi there,

You missed return type in your closure, please see the API docs
Thats actually a mistake in API and that will be fixed in one of the next nightly builds

For now, please use the code like below:

lineAnnotation.annotationSelectionChangedListener = { (annotation, isSelected) -> Bool in
    print("isSelected: \(isSelected)")
    return true
}

Hope that helps.

Best Regards,
Nazar R.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.