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

0
0

Hi,

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?

Regards.

Version
iOS v1.2.4.1045_SDK
  • You must to post comments
0
0

Hi,

There is one workaround for you.

xMaxMarker = [[SCIAxisMarkerAnnotation alloc] init];
xMaxMarker.coordMode = SCIAnnotationCoord_Absolute;
xMaxMarker.xAxisId = @"xAxis";
xMaxMarker.position = SCIGeneric(9);
xMaxMarker.style.markerLinePen = [[SCIPenSolid alloc] initWithColorCode:0xAFFFFF00 Width:1];
xMaxMarker.style.backgroundColor = [UIColor fromColorCode:0xFFCFCF30];
xMaxMarker.style.textStyle.transform = 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.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies