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.
- Develle Yong asked 7 years ago
- You must login to post comments
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
- Mykola Hrybeniuk answered 7 years ago
- You must login to post comments
Please login first to submit.