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
- Haoran Xie asked 5 years ago
- last edited 5 years ago
- You must login to post comments
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.
- Nazar Rudnyk answered 5 years ago
-
invalidateElement works. Thanks
- You must login to post comments
Please login first to submit.