How to Zoom and Pan to thow last 20 candles

3 posts, 1 answers
  1. qq
    qq avatar
    8 posts
    Member since:
    Nov 2015

    Posted 18 Sep 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
    19 posts

    Posted 21 Sep 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. DevCraft R3 2016 release webinar banner
  4. qq
    qq avatar
    8 posts
    Member since:
    Nov 2015

    Posted 21 Sep 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