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

How to change text color of axis labels?

2 Answers 366 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.
Brandix
Top achievements
Rank 1
Brandix asked on 03 Jul 2014, 10:02 AM
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 Answers, 1 is accepted

Sort by
0
Adrian
Telerik team
answered on 04 Jul 2014, 08:36 AM
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.

 
0
Brandix
Top achievements
Rank 1
answered on 07 Jul 2014, 04:19 AM
Thank you for the quick reply. It worked!
Tags
Chart
Asked by
Brandix
Top achievements
Rank 1
Answers by
Adrian
Telerik team
Brandix
Top achievements
Rank 1
Share this question
or