This is a migrated thread and some comments may be shown as answers.

How to Zoom and Pan to thow last 20 candles

2 Answers 31 Views
Chart
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
qq
Top achievements
Rank 1
qq asked on 18 Sep 2016, 08:49 AM

I have a chart with 300 holc data. So I got 300 candles.

But I want show tha last 20 candles to the user when the view is created. And then user can zoom and pan to see more data by finger.

 

We have implement this feature with android version.

How can I do that with ios version?

Thank you very much.

2 Answers, 1 is accepted

Sort by
0
Accepted
Miroslava
Telerik team
answered on 21 Sep 2016, 06:52 AM
Hello,

Thank you for contacting us.

TKChartAxis allows panning to a specific data point by calling panToDataPoint: method. In your you should pass the last data point. Please consider the code snippet below. 

TKChartScatterSeries *series = [[TKChartScatterSeries alloc] initWithItems:items];
[_chart addSeries:series];
 
_chart.xAxis.allowZoom = YES;
_chart.xAxis.zoom = 10;
[_chart.xAxis panToDataPoint:[series.items lastObject]];

I hope this helps. If you need further assistance, do not hesitate to contact us.

Regards,
Miroslava
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
qq
Top achievements
Rank 1
answered on 21 Sep 2016, 07:23 AM

It works.

Thank you very much. It annoyed us many days.

I can focus on other functions now. 

Tags
Chart
Asked by
qq
Top achievements
Rank 1
Answers by
Miroslava
Telerik team
qq
Top achievements
Rank 1
Share this question
or