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

Changing Axis Label Style: Font and color

2 Answers 147 Views
Chart - Xamarin.iOS
This is a migrated thread and some comments may be shown as answers.
Tomer
Top achievements
Rank 1
Tomer asked on 15 Apr 2016, 10:24 AM

Hi,

I am trying to change the X-Axis label style for a line-chart.

In specific, I am attempting to change the font, as well as the label text color in the following way:

 

var series = new TKChartLineSeries(graphData.ToArray());
series.Style.Stroke = new TKStroke(ConvertToUIColor(lineColor));
peakTimeChart.AddSeries(series);
 
peakTimeChart.XAxis.Style.MajorTickStyle.TicksHidden = true;
peakTimeChart.XAxis.Style.MinorTickStyle.TicksHidden = true;
peakTimeChart.XAxis.Style.LineStroke = new TKStroke(ConvertToUIColor(axisColor));
peakTimeChart.XAxis.Style.LabelStyle.TextColor = UIColor.Red;
peakTimeChart.XAxis.Style.LabelStyle.Font = UIFont.FromName("Avenir Next Condensed", 7f);
peakTimeChart.ReloadData();

     

Everything seems to be working, except of the label color and font.

I tried to to reload data as was suggested in the iOS-UI forum, but that didn't seem to work.

 

Am I missing anything?

 

2 Answers, 1 is accepted

Sort by
0
Sophi
Telerik team
answered on 20 Apr 2016, 02:14 PM
Hi Tomer,

I tried reproducing the behavior you have explained but everything seems to work just fine within my project.
Could you please send us a sample project demonstrating the issue so we can investigate and provide you with solution immediately.
Thank you for your understanding.
Looking forward to hearing from you. 

Regards,
Sophi
Telerik
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
0
Tomer
Top achievements
Rank 1
answered on 21 Apr 2016, 03:18 PM

Thanks Sophie,

I just added:

peakTimeChart.Update();

at the end, and it seems to be wokring :)

 

Tags
Chart - Xamarin.iOS
Asked by
Tomer
Top achievements
Rank 1
Answers by
Sophi
Telerik team
Tomer
Top achievements
Rank 1
Share this question
or