Thread is closed for posting
3 posts, 0 answers
  1. Jerry
    Jerry avatar
    2 posts
    Member since:
    May 2015

    Posted 14 May 2015 Link to this post

    I am not able to change the text color for the x or y Axis.  I have read post after post and still, I am not able to make the text change color.  Any help would be appreciated.  Here is the code I am using to initialize the chart:

      _lineSeries3Month = [[TKChartAreaSeries alloc] initWithItems:_points];

      [self.chartView addSeries:_lineSeries3Month];

      _lineSeries3Month.selectionMode = TKChartSeriesSelectionModeDataPoint; = [TKPredefinedShape shapeWithType:TKShapeTypeCircle andSize:CGSizeMake(8.f, 8.f)]; = TKChartSeriesStyleShapeModeAlwaysShow; = [UIColor whiteColor]; = NO;
      self.chartView.allowAnimations = YES;
      self.chartView.title.hidden = YES;

      [self.chartView reloadData];

  2. Jerry
    Jerry avatar
    2 posts
    Member since:
    May 2015

    Posted 14 May 2015 in reply to Jerry Link to this post


     I cloned the telerik/ios-sdk from Github and modified the Customize Example App to change the yAxis text color to red and it did not work.  The Customize example was setting the yAxis to black and the only thing I changed was to change the color to red.  However, when executing the App, it did not change to red but, remained black.

  3. Adrian
    Adrian avatar
    174 posts

    Posted 18 May 2015 Link to this post

    Hello Jerry,

    Thank you for contacting us.

    After investigating the scenario I can confirm that there is an issue when you try to set the textColor property of TKChartAxisLabelStyle after the series are added to the chart. I logged it in our feedback portal. Feel free to vote/comment the issue. I also updated your Telerik point for reporting it. The issue will be addressed in a future version of UI for iOS. Until then a possible way to change the color of the axis labels is to invoke the update method of TKChart. This method updates the chart's UI. Please consider the code snippet below:
    TKChartLineSeries *series = [[TKChartLineSeries alloc] initWithItems:dataPoints];
    [_chart addSeries:series]; = [UIColor redColor];
    [_chart update];

    Please note that if you are using automatic axes and you call the reloadData method of TKChart, the axes styles will be overriden to the default ones and the color of the labels will be black - the default.

    I hope this helps. if you have further questions, do not hesitate to contact us.

    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
Back to Top