Mediocre documentation of pan property

Thread is closed for posting
2 posts, 0 answers
  1. Manuel
    Manuel avatar
    2 posts
    Member since:
    Mar 2015

    Posted 11 Mar 2015 Link to this post

    Hello there

    We develop charts for iOS 8 using the TelerikUI.framework (can't evaluate what version, but the latest). 

    Drawing a chart form a JSON source works like a charm, so thanks for those great examples.

    What we try to achieve is to load a bar chart with a TKChartDateTimeAxis as x-axis. The idea is, to load 30 datapoints/bars with 30 different (subsquent) dates but only show the last 7 of those data points. I achieved that only 7 bars are displayed by setting xAxis.zoom=7. Now I have to set the pan, so the view shows the right most bars and not the left most bars.

    The documentation of the pan in
    only tells me 'The pan level of the axis.'. Not relative to what, or how it is measured...

    Thanks for any hints.
  2. Jack
    Jack avatar
    2333 posts

    Posted 11 Mar 2015 Link to this post

    Hi Manuel,

    Thank you for your interest in our controls.

    The pan value property determines the start index for the axis. The start index is calculated by dividing the pan value by the time interval specified by the majorTickIntervalUnit property measured in seconds. for example if it is measured in days, it will be pan / 60 * 60 * 24 * 7. However, in this scenario I would recommend using the category axis where the calculations are much simpler. You only have to convert your dates to numbers or strings. Here is a sample where we assume that the x axis is TKChartCategoryAxis:
    TKChartCategoryAxis *xAxis = (TKChartCategoryAxis*)_chart.xAxis;
    xAxis.majorTickInterval = 1;
    xAxis.zoom = 4;
    xAxis.pan = 22;
    xAxis.allowPan = YES;

    I hope this helps. Do not hesitate to write back if you need further assistance.


    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top