DataSource protocol for axis?

Thread is closed for posting
2 posts, 0 answers
  1. EY
    EY avatar
    7 posts
    Member since:
    Nov 2014

    Posted 28 Nov 2014 Link to this post

    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?
  2. Jack
    Jack avatar
    2333 posts

    Posted 02 Dec 2014 Link to this post


    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.


    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