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

Change Axis title font size

4 Answers 156 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Martin
Top achievements
Rank 1
Martin asked on 12 May 2014, 08:02 AM
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?

4 Answers, 1 is accepted

Sort by
0
Sia
Telerik team
answered on 14 May 2014, 03:49 PM
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.
 
0
Peter
Top achievements
Rank 1
answered on 15 Oct 2015, 05:53 AM

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.

0
Petar Marchev
Telerik team
answered on 19 Oct 2015, 10:34 AM
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
0
Peter
Top achievements
Rank 1
answered on 19 Oct 2015, 11:46 AM

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

Tags
ChartView
Asked by
Martin
Top achievements
Rank 1
Answers by
Sia
Telerik team
Peter
Top achievements
Rank 1
Petar Marchev
Telerik team
Share this question
or