We have implemented a zoomable line chart in an iOS app. We need to detect when user does a zoom event and get new extremes after zoom, and to achieve that, we have added an event to xAxis, exactly we have added the event afterSetExtremes. In the event we have included a function to get new extremes, but seams it does not work correctly.
The function is execute correctly when user zoom the graph, but we cannot get the new properties to get new extremes values. Does anyone know if there is a bug? or how to get it. We receive null value into event.min and event.max properties.
We have implemented code as following:
1. Event added to xAxis object:
HIXAxis *xaxis = [[HIXAxis alloc]init];
xaxis.type = @"datetime";
xaxis.events = event;
2. Event definition:
HIEvents *event = [[HIEvents alloc]init];
event.afterSetExtremes = function;
3. Function definition:
HIFunction * function = [[HIFunction alloc] initWithClosure:^(HIChartContext *context) {
NSNumber *min = [context getProperty:@"event.min"];
NSNumber *max = [context getProperty:@"event.max"];
NSLog(@"min value: %ld", min);
NSLog(@"max value: %ld", max);
} properties:@[@"event.min", @"event.max"]];
We have tried to get event.dataMin, event.dataMax, min, max, and we receive null to all properties. Does anybody know how to get new extremes after user zoom graph?
Thanks in advance
Eduard