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

DataSource protocol for axis?

1 Answer 40 Views
General Discussion
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
EY
Top achievements
Rank 2
EY asked on 28 Nov 2014, 01:37 PM
Is there a DataSource protocol for axes.

Is it possible to update minimum value, maximum value and majorTickInterval of an existing axis using DataSource protocol?
If not, how can they be updated?

Removing the existing one and adding a new axis looks like the only solution. 
But removeAxis method does not seem to work, old Axis remains visible.

And what is the difference between adding an xAxis to a TKChart, and setting xAxis of a TKChartSeries?

1 Answer, 1 is accepted

Sort by
0
Jack
Telerik team
answered on 02 Dec 2014, 09:30 AM
Hi,

Yes, you can change all axis properties at runtime. However, TKChart will not reflect the changes until you call the reloadData method. Here is a sample:
TKChartNumericAxis *axis = (TKChartNumericAxis*)_chart.xAxis;
axis.range = [TKRange rangeWithMinimum:@10 andMaximum:@150];
axis.majorTickInterval = @30;
[_chart reloadData];

Regarding the removeAxis method, I confirm that this method is not working properly. I logged the issue in our feedback portal where you can track the issue status. I updated also your Telerik points for reporting this issue. 

You can work around the issue by replacing the existing axis. Consider the following code:
TKChartSeries *series = _chart.series[0];
series.xAxis = [[TKChartNumericAxis alloc] initWithMinimum:@10 andMaximum:@160];

I hope this helps.

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
General Discussion
Asked by
EY
Top achievements
Rank 2
Answers by
Jack
Telerik team
Share this question
or