This is a migrated thread and some comments may be shown as answers.
Some unexpected behavior
3 Answers 20 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Alex
Top achievements
Rank 1
Alex asked on 30 Oct 2014, 05:52 AM
I document several weird chart behaviors in the attached file:
1. Effect of setting textOffset
2. Missing labels
3. Setting categoryAxis

Please let me know if you need additional information. The file is a word doc but I am renaming it as .jpg so that I can attach it here.

3 Answers, 1 is accepted

Sort by
0
Adrian
Telerik team
answered on 30 Oct 2014, 05:39 PM
Hi Alex,

Thank you for contacting us.

1. To calculate the axis width, TKChart uses its maximum value. However, using custom formatted strings where the maximum value is nil breaks our internal logic and cases the described issue to appear. The issue appears when label style textAlignment property is set to Left. This issue will be addressed in one of our upcoming releases. You can track the issue status in our feedback portal. I also updated your Telerik points for reporting it.

A possible work around for this issue is to align axis labels on the right side, just like on the screenshots you provided. You should set the textAlignment property to 

TKChartAxisLabelAlignment.Right  

and then set the desired textOffset. Please consider the code snippet below:
yAxis.style.labelStyle.textAlignment = TKChartAxisLabelAlignment.Right
yAxis.style.labelStyle.textOffset = UIOffset(horizontal: 40, vertical: 0)

2. TKChartDateTimeAxis allows you to modify its interval unit and tick interval using its majorTickIntervalUnit and majorTickInterval properties. To show the time labels in 1 hour interval like on the screenshots, you should set the majorTickIntervalUnit property to TKChartDateTimeAxisIntervalUnit.Hours and the majorTickInterval property to 1 like in the following code snippet:
let xAxis = TKChartDateTimeAxis()
xAxis.majorTickIntervalUnit = TKChartDateTimeAxisIntervalUnit.Hours
xAxis.majorTickInterval = 1
series.xAxis = xAxis

3. I wasn't able to reproduce the described behaviour. Could you, please, send me a sample project where the issue appears. This will help me investigate it and provide you with proper solution. Thank you for your understanding and cooperation.

I am looking forward to your reply.

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
Alex
Top achievements
Rank 1
answered on 31 Oct 2014, 03:18 AM
Hi Adrian,

Thank you for your detailed answers. You guys are great!

I tried to reproduce item 3 myself today but have not been able to :-). I will let you know when I see the behavior again.

Alex
0
Adrian
Telerik team
answered on 31 Oct 2014, 09:30 AM
Hi Alex,

Thank you for this update. I am glad to hear that everything seems to be OK now. If you need further assistance, I will be happy to help you.

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.

 
Tags
Chart
Asked by
Alex
Top achievements
Rank 1
Answers by
Adrian
Telerik team
Alex
Top achievements
Rank 1
Share this question
or