Pre loader

[iOS] Limit x-axis panning at annotation's position

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’m trying to limit the x-axis panning up to an annotation that I’ve drawn on the graph. This annotation can be beyond the current data’s position (i.e. data’s timestamp is at 5/4/2017 11:00:00, annotation’s position is at 5/4/2017 16:00:00). Is there a method, or any way that I can use to limit the x-axis panning up to the annotation’s position instead of limiting it to the data series’ max X?


iOS v1.2.4.1045_SDK
  • You must to post comments


There is one workaround for you.

xMaxMarker = [[SCIAxisMarkerAnnotation alloc] init];
xMaxMarker.coordMode = SCIAnnotationCoord_Absolute;
xMaxMarker.xAxisId = @"xAxis";
xMaxMarker.position = SCIGeneric(9); = [[SCIPenSolid alloc] initWithColorCode:0xAFFFFF00 Width:1]; = [UIColor fromColorCode:0xFFCFCF30]; = CGAffineTransformMakeRotation(M_PI_2);

axis = [[SCINumericAxis alloc] init];
[axis setAxisId: @"xAxis"];

[axis registerVisibleRangeChangedCallback:^(id<SCIRange> newRange, id<SCIRange> oldRange, BOOL isAnimated, id sender) {
    double maxNewRange = SCIGenericDouble([newRange max]);
    double xMaxAnnotation = SCIGenericDouble(_xMaxMarker.position);

    if (maxNewRange > xMaxAnnotation) {
        [axis setVisibleRange:[[SCIDoubleRange alloc] initWithMin:[oldRange min] Max:_xMaxMarker.position]];

Best Regards, Mykola

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.