How to change text color of axis labels?

3 posts, 0 answers
  1. Brandix
    Brandix avatar
    2 posts
    Member since:
    May 2014

    Posted 03 Jul 2014 Link to this post

    I tried following code,

        TKChartBarSeries *series = [[TKChartBarSeries alloc] initWithItems:randomData];
        [self.chart addSeries:series];
       
        series.style.palette = [TKChartPalette new]

      series.xAxis.style.backgroundFill = [TKSolidFill solidFillWithColor:[UIColor whiteColor]]; // This line works!

        series.yAxis.style.labelStyle.textColor = [UIColor redColor]; // This line does not work...

    What is the correct way of changing the text color of x and y axis values?
  2. Adrian
    Admin
    Adrian avatar
    167 posts

    Posted 04 Jul 2014 Link to this post

    Hello Brandix,

    Thank you for contacting us.

    You should call the reloadData method of TKChart when changing the axis labels color in this case. This is necessary, because TKChart does not update its visual appearance automatically on property changes after the series is being added to the chart. Consider the code snippet below:

    TKChartBarSeries *series = [[TKChartBarSeries alloc] initWithItems:randomData];
    [self.chart addSeries:series];
      
    series.xAxis.style.backgroundFill = [TKSolidFill solidFillWithColor:[UIColorwhiteColor]];
    series.yAxis.style.labelStyle.textColor = [UIColor redColor];
    [self.chart reloadData];

    I hope this helps. Do not hesitate to contact us if you need further assistance.

    Regards,
    Adrian
    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.

     
  3. DevCraft banner
  4. Brandix
    Brandix avatar
    2 posts
    Member since:
    May 2014

    Posted 06 Jul 2014 in reply to Adrian Link to this post

    Thank you for the quick reply. It worked!
Back to Top