YAxis title offset from axis labels

4 posts, 1 answers
  1. Ladislav
    Ladislav avatar
    5 posts
    Member since:
    Jun 2013

    Posted 10 Dec 2014 Link to this post

    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!
  2. Answer
    Pavel Pavlov
    Admin
    Pavel Pavlov avatar
    2039 posts

    Posted 10 Dec 2014 Link to this post

    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.

     
  3. DevCraft banner
  4. Ladislav
    Ladislav avatar
    5 posts
    Member since:
    Jun 2013

    Posted 10 Dec 2014 in reply to Pavel Pavlov Link to this post

    Thank you for your answer.
    I created a suggestion in your feedback portal.
  5. Pavel Pavlov
    Admin
    Pavel Pavlov avatar
    2039 posts

    Posted 10 Dec 2014 Link to this post

    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.

     
Back to Top
DevCraft banner