Change Axis title font size

5 posts, 0 answers
  1. Martin
    Martin avatar
    3 posts
    Member since:
    Feb 2014

    Posted 12 May 2014 Link to this post

    Hi,
    I'm using RadChartView and dynamically change font size of Axis title at runtime. But RadChartView doesn't rerender itself. The same problem appears when the font size of axis label is changed.
    Could you give me some advice how to ensure that RadChartView will be rerendered in these situations?
  2. Sia
    Admin
    Sia avatar
    667 posts

    Posted 14 May 2014 Link to this post

    Hello Martin,

    Can you please send us a small application reproducing your problem or give us more details about your scenario so that we can give you a proper solution? How do you change the FontSize?

    Please note that you need to use the exposed  properties of the axis - i.e. TitleTemplate.

    Regards,
    Sia
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Peter
    Peter avatar
    10 posts
    Member since:
    Apr 2014

    Posted 15 Oct 2015 in reply to Sia Link to this post

    Hello,

    was this ever solved? I have more or less the same question. I'm using TitleTemplate to set the title to a Label. In that Label, I'm setting the Visibilty property to be bound to a certain boolean property of my ViewModel. This way (with a BooleanToVisibilityConverter), I can show or hide the titles. The objective is to make the ChartView bigger when the title isn't shown. But the ChartView doesn't re-render when I hide the title. This wouldn't be a problem if I could force the ChartView to redraw itsself, taking in all the space that it can.

  5. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 19 Oct 2015 Link to this post

    Hi Peter,

    I think that the original issue in this thread is now resolved. It seems that the chart did not support dynamic font-size changes at the time of the post, but we implemented this about a year ago.

    However, note that what we implemented last year concerns only the FontSize property of the direct chart elements, such as the chart itself, the axis, the series and so on. If you were to change the font size or visibility within a custom template, the change will not be detected and the chart will not update.

    I want to elaborate this a little bit. The chart caches many things, amongst which is the size of the axis title. If you change the FontSize property of the chart, the Title or the TitleTemplate, the chart will detect this change and will redraw properly. However if you change something in the template, the chart will not update, because it already cached some size and it is going to use it from now on.

    With this being said, it is clear that you should not use a visibility converter within the template, but clear the Title property of the axis if you do not want it displayed.

    Let us know if you need more information.

    Regards,
    Petar Marchev
    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
  6. Peter
    Peter avatar
    10 posts
    Member since:
    Apr 2014

    Posted 19 Oct 2015 in reply to Petar Marchev Link to this post

    Hi Petar,

    yes, I think I can work with that. I'll have to check it out and it isn't a priority right ​now. We've chosen to remove all axis titles for now, as the end-user knows what they are. But I'll try it out when I find the time.

    Thanks,

    Peter

Back to Top
UI for WPF is Visual Studio 2017 Ready