Pre loader

Dragging Multiple Axis Marker Annotations

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


I am considering applying server-side licensing for my javerScript application.

In the document below, there is a phrase “Our server-side licensing component is written in C++.”

However, there is only sample code on the provided github.

I wonder if there is a sample code implemented in C++ for server-side licensing.

Can you provide c++ sample code?
Also, are there any examples to run on Ubuntu?

  • Kelvin Roy
    I am looking for exact same feature for a finance app. Android has this capability, can it be added to iOS as well? This is a deciding factor and we need to integrate as soon as possible
  • You must to post comments

Good day

There was bug in SCIModifierGroup. So you need latest version of SDK. You can get it at this link

You need to add some kind of hit test to your code to check what annotation to move.
After that you have to set the following option for SCIAnnotationGroup

[annotationGroup setHandleGestureFirstOnly:YES];

Taht means if annotation returns YES from gesture handler, gesture is considered handled and won’t be checked by other annotations. In that case when annotations are placed at the same position you can drag them separately.

Assuming you are using absolute coordinate mode for SCIAxisMarkerAnnotation placement:

 marker.coordMode = SCIAnnotationCoord_Absolute;

You can do the following:

@class CDAxisMarkerAnnotation;

@protocol CDAxisMarkerAnnotationDelegate <NSObject>

- (void)axisMarkerAnnotation:(CDAxisMarkerAnnotation *)axisMarkerAnnotation


@interface CDAxisMarkerAnnotation : SCIAxisMarkerAnnotation

@property (weak, nonatomic) id<CDAxisMarkerAnnotationDelegate> delegate;


@implementation CDAxisMarkerAnnotation {
    BOOL _gestureLocked;

- (BOOL)onPanGesture:(UIPanGestureRecognizer *)gesture At:(UIView *)view

    if (![view isKindOfClass:[SCIChartSurfaceView class]]) {
        return [super onPanGesture:gesture At:view];

    CGPoint location = [gesture locationInView:view];
    id<SCIRenderSurface> renderSurface = [self.parentSurface renderSurface];
    CGPoint pointInChart = [renderSurface pointInChartFrame:location];
    id<SCICoordinateCalculator> yCalculator = [self.yAxis getCurrentCoordinateCalculator];
    double valueForYAxis = [yCalculator getDataValueFrom:pointInChart.y];

    switch (gesture.state) {
        case UIGestureRecognizerStateBegan: {
            double markerCoord = [yCalculator getCoordinateFrom:SCIGenericDouble(self.position)];
            const double hitTestDistance = 25;
            BOOL pointInHitTest = fabs(pointInChart.y - markerCoord) < hitTestDistance;
            if ( !pointInHitTest ) return GESTURE_NOT_HANDLED;
            _gestureLocked = YES;
        case UIGestureRecognizerStateChanged:
            if (!_gestureLocked) return GESTURE_NOT_HANDLED;
//            [self.delegate axisMarkerAnnotation:self didPanToAxisValue:valueForYAxis];
            // I don't know what "axisMarkerAnnotation:didPanToAxisValue:" actually do, but the following code moves your axis marker and triggers redraw
            [self setPosition:SCIGeneric(valueForYAxis)];
            [renderSurface invalidateElement];
        case UIGestureRecognizerStateEnded:
            _gestureLocked = NO;
        default: {


Please let me know if you have troubles using that example

Best regards
SciChart iOS Developer

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.