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

YAxis title offset from axis labels

3 Answers 164 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.
Ladislav
Top achievements
Rank 1
Ladislav asked on 10 Dec 2014, 07:48 AM
Hello,
Is there any option, how to make gap between yaxis title and labels larger. As you can see in attached picture, it does not look well.
Code snippet:

        var yLeftAxis = TKChartNumericAxis(range: TKRange(statisticItems: [data[0], data[1]]))
        var yRightAxis = TKChartNumericAxis(range: TKRange(statisticItems: [data[2]]))
        
        yLeftAxis.position = TKChartAxisPosition.Left;
        yLeftAxis.style.lineHidden = false
        yLeftAxis.style.labelStyle.firstLabelTextAlignment = TKChartAxisLabelAlignment.Left;
        yLeftAxis.style.labelStyle.firstLabelTextOffset = UIOffset(horizontal: 10, vertical: 0);
        yLeftAxis.style.labelStyle.textOffset = UIOffset(horizontal: 10, vertical: 0)
        yLeftAxis.title = "Straty (MWh)"
        yLeftAxis.style.titleStyle.rotationAngle = CGFloat(MathHelper.degreeToRadian(-90))
        
        yRightAxis.position = TKChartAxisPosition.Right;
        yRightAxis.style.lineHidden = false
        yRightAxis.style.labelStyle.firstLabelTextAlignment = TKChartAxisLabelAlignment.Left;
        yRightAxis.style.labelStyle.firstLabelTextOffset = UIOffset(horizontal: 10, vertical: 0);
        yRightAxis.style.labelStyle.textOffset = UIOffset(horizontal: 10, vertical: 0)
        yRightAxis.title = "Rozdiel strĂ¡t (MWh)"
        yRightAxis.style.titleStyle.rotationAngle = CGFloat(MathHelper.degreeToRadian(90))


Thank you!

3 Answers, 1 is accepted

Sort by
0
Accepted
Pavel Pavlov
Telerik team
answered on 10 Dec 2014, 11:51 AM
Hello Ladislav,

I am afraid the style API for the axis label currently does not support  an easy way to do that. 

I am afraid the only thing I can suggest is a kind of a hack e.g. add some text white space to achieve the effect such as : 

 yLeftAxis.title = @"Straty (MWh)\n";

This should insert a blank text line between the labels and the title.

Hope that helps.

Regards,
Pavel Pavlov
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
Ladislav
Top achievements
Rank 1
answered on 10 Dec 2014, 12:03 PM
Thank you for your answer.
I created a suggestion in your feedback portal.
0
Pavel Pavlov
Telerik team
answered on 10 Dec 2014, 12:20 PM
Hi Ladislav,

Thanks for your suggestion and feedback. I have updated your Telerik points.

Thanks
Regards,
Pavel Pavlov
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
Ladislav
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Ladislav
Top achievements
Rank 1
Share this question
or