Can't set Title color after switching ColorTheme
Posted: Thu Mar 19, 2020 11:09 am
I have set the ColorTheme of the chart in code-behind, and then the color I set for my AxisYTitle in xaml is ignored.
Trying to set the text Color after changing the color theme also has no effect. Changing the Fill however works:
(I don't actually want these specific colors, they are just to make it apparent that something happens)
Without the change of ColorTheme the change of text color takes effect.
Is this a bug, or am I missing something?
A second question is that I would prefer being able to set colors directly in xaml, is that possible to do and also change ColorTheme?
Using version 8.5.1.1 semi-bindable, on .NET Core 3.1.
Edit: Some additional info is that there actually are two charts in the same user control, and ColorTheme is changed on both.
Edit 2: As I change things while developing sometimes the color actually gets set, but the pattern to it is not clear to me. Could it be some sort of race condition?
I also have the same problem with the Fill color for an AnnotationXY. Whether I set it in xaml or code-behind after changing ColorTheme, the color is simply ignored. I can however for example set the Fill color for instances of AxisYTitle and AxisXTitle used as AxisY.Units respectively AxisX.Units.
Thanks,
Magnus
Trying to set the text Color after changing the color theme also has no effect. Changing the Fill however works:
Code: Select all
Chart.ColorTheme = ColorTheme.LightGray;
Chart.ViewXY.YAxes[0].Title.Color = Colors.DeepPink; // This has no effect when ColorTheme is set above
Chart.ViewXY.YAxes[0].Title.Fill.Color = Colors.Gold; // But this works
Without the change of ColorTheme the change of text color takes effect.
Is this a bug, or am I missing something?
A second question is that I would prefer being able to set colors directly in xaml, is that possible to do and also change ColorTheme?
Using version 8.5.1.1 semi-bindable, on .NET Core 3.1.
Edit: Some additional info is that there actually are two charts in the same user control, and ColorTheme is changed on both.
Edit 2: As I change things while developing sometimes the color actually gets set, but the pattern to it is not clear to me. Could it be some sort of race condition?
I also have the same problem with the Fill color for an AnnotationXY. Whether I set it in xaml or code-behind after changing ColorTheme, the color is simply ignored. I can however for example set the Fill color for instances of AxisYTitle and AxisXTitle used as AxisY.Units respectively AxisX.Units.
Thanks,
Magnus