SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components

Welcome to the SciChart Community Forums!

Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy. We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!

Please note: SciChart team will only answer questions from customers with active support subscriptions. Expired support questions will be ignored. If your support status shows incorrectly, contact us and we will be glad to help.

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.