Pre loader

Custom Cursor

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

2
0

I’m trying to create a spectrum viewer with your library. One important feature is a cursor supporting both automatic mode and manual mode. In automatic mode, it stays at the maximum value. In manual mode, it moves with finger panning. It’s close to the SCICursorModifier with the cross lines, but it should always stay on the plot even without touch. Also it should reside on real data points instead of anywhere in between like the SCIRolloverModifier instead of the SCICursorModifier.

Could you give me some advices about how to achieve it? Thanks.

EDIT: after reading more of your documents, I believe HorizontalLineAnnotation and VerticalLineAnnotation are the way to go. I have already added them as the automatic mode cursor. For the manual mode, I still need your help to achieve either:
1) a callback function for the VerticalLineAnnotation drag event, so that I could move both lines to the corresponding data point
or
2) a custom ZoomPanModifier to allow me to distinguish one point or two points touch: one point panning to move the whole plot and two points panning to determine the new cursor location and redraw the two annotations there

EDIT2: I was able to create a custom VerticalLineAnnotation class to handle the panning event. There is one more question left. Right now in order to update the verticallineannotation and horizontallineannotation on the graph, I remove them from sciChartSurface.annotations, change x/y locations and add them back. Is there a redraw or refresh or update function to call directly?

Thanks

Version
v2.2.1.2260
  • You must to post comments
0
0

Hello Haoran,

Thanks for writing to us. According to your edits, you just need to refresh annotation – to do so, just use invalidateElement method on your annotation, or directly on your sciChartSurface, that will trigger redraw needed elements.

Best Regards,
Nazar R.

  • Haoran Xie
    invalidateElement works. Thanks
  • 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