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

Mediocre documentation of pan property

1 Answer 33 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.
Manuel
Top achievements
Rank 1
Manuel asked on 11 Mar 2015, 09:22 AM
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 
http://docs.telerik.com/devtools/ios/api/Classes/TKChartAxis.html#//api/name/pan
only tells me 'The pan level of the axis.'. Not relative to what, or how it is measured...

Thanks for any hints.
Cheers

1 Answer, 1 is accepted

Sort by
0
Jack
Telerik team
answered on 11 Mar 2015, 10:07 AM
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.

Regards,
Jack
Telerik
 

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.

 
Tags
Chart
Asked by
Manuel
Top achievements
Rank 1
Answers by
Jack
Telerik team
Share this question
or