Programatically scroll to a datapoint


#1

Hi,

How can I programmatically scroll to a specific datapoint of a linechart series when a button event is triggered?

Thanks!


#2

Hey,

You can use the  setRangeWithMinimum:andMaximum:** withAnimation: method on SChartAxis** to move your axis range to ‘frame’ your datapoint - for example, if your datapoint is at (5,10):

[chart.xAxis setRangeWithMinimum:@3 andMaximum:@7 withAnimation:YES];
[chart.yAxis setRangeWithMinimum:@8 andMaximum:@12 withAnimation:YES];

I hope this helps!

Simon