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
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
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.
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
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