How to Zoom and Pan to thow last 20 candles

Thread is closed for posting
3 posts, 1 answers
  1. qq
    qq avatar
    8 posts
    Member since:
    Nov 2015

    Posted 18 Sep 2016 Link to this post

    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. Answer
    Miroslava avatar
    27 posts

    Posted 21 Sep 2016 Link to this post


    Thank you for contacting us.

    TKChartAxis allows panning to a specific data point by calling panToDataPoint: method. In your case 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.

    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
  3. qq
    qq avatar
    8 posts
    Member since:
    Nov 2015

    Posted 21 Sep 2016 in reply to Miroslava Link to this post

    It works.

    Thank you very much. It annoyed us many days.

    I can focus on other functions now. 

Back to Top