Customizing Axis's Label and Title in RadCartesianChart

3 posts, 0 answers
  1. Ighor
    Ighor avatar
    2 posts
    Member since:
    Jun 2015

    Posted 17 Jun 2015 Link to this post

    Hi,

     

    1) I need to place the HorizontalAxis Label above the chart. Is that possible?

    2) I am trying to change the alignment of both Axis's titles: the HorizontalAxis Title to "left" and the VerticalAxis Title to "bottom" (near Chart's origin). How can I do that?

     

    Could you show me a code example?

     

    Thank you.

  2. Martin
    Admin
    Martin avatar
    1101 posts

    Posted 18 Jun 2015 Link to this post

    Hi Ighor,

    Let me get straight to your questions:
    •  I need to place the HorizontalAxis Label above the chart. Is that possible?
      I am not sure what you mean by saying that you want to place the HorizontalAxis Label above the axis. Do you mean that you want to position the axis' labels above the plot area. If so, you can move the entire axis by changing its VerticalLocation property to Top.
      <telerik:CategoricalAxis VerticalLocation="Top"/>
      If this is not what you are looking for, can you please describe the desired result? Drawings with the expected look also will be very helpful for understanding your case.
    •  I am trying to change the alignment of both Axis's titles: the HorizontalAxis Title to "left" and the VerticalAxis Title to "bottom" (near Chart's origin). How can I do that?
      Currently, there is no built-in mechanism for setting the alignment of the chart's axis title. However, you can achieve this with custom code. Basically, you can find the ContentPresenter that holds the axis' title in code and when the chart's layout is updated set the Canvas.Top/Canvas.Left attached property of the presenter to position it at the desired location. I attached a sample project that demonstrates this approach. Please give it a try and let me know if it works for you.
    I hope this helps.

    Regards,
    Martin
    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
  3. UI for WPF is Visual Studio 2017 Ready
  4. Ighor
    Ighor avatar
    2 posts
    Member since:
    Jun 2015

    Posted 18 Jun 2015 in reply to Martin Link to this post

    Hi Martin,

     

    This is exactly what i've meant. And it was helpful, worked for me!

     

    Thank you,

    Ighor.

Back to Top