Is there any way to force a refresh/rebuild of the chart so that the labels are correctly positioned after a runtime change of the font size? Ideally, in a MVVM way?
Currently, if you bind the font size to a property in the ViewModel and change it, the chart is not repositioned properly to accommodate the change in size. See attached pics showing undesirable results of changing the font size, both when increasing or decreasing from the initial size.
Here's some code:
What is the best way to accomplish a dynamic font size change?
Currently, if you bind the font size to a property in the ViewModel and change it, the chart is not repositioned properly to accommodate the change in size. See attached pics showing undesirable results of changing the font size, both when increasing or decreasing from the initial size.
Here's some code:
<
chart:RadCartesianChart.VerticalAxis
>
<
chartView:LinearAxis
FontFamily
=
"Segoe UI"
FontSize
=
"{Binding AxisFontSize}"
Title
=
"{Binding AxisTitle}"
Minimum
=
"0"
Maximum
=
"{Binding AxisMaxValue}"
LabelFormat
=
"{Binding AxisLabelFormat}"
>
</
chartView:LinearAxis
>
</
chart:RadCartesianChart.VerticalAxis
>
public
double
AxisFontSize
{
get
{
return
this
._axisFontSize;
}
set
{
if
(
this
._axisFontSize != value )
{
this
._axisFontSize = value;
this
.OnPropertyChanged(
"AxisFontSize"
);
this
.OnPropertyChanged(
"AxisLabelFormat"
);
}
}
}
What is the best way to accomplish a dynamic font size change?