Hi! I tried everything but I cannot make any change to the fonts (size, color etc.) on any of the X and Y axis labels. Here is an example code, which doesn't work!
LabelStyle style = new LabelStyle()
{
FontFamily = new FontFamily("Algerian"),
FontSize = 20,
Foreground = new SolidColorBrush(Colors.Blue)
};
CategoryAxis primaryAxis = new CategoryAxis()
{
LabelStyle = style,
//Doesn't work
//FontSize = 20, //Doesn't work
//FontStyle = FontStyles.Italic,
//Doesn't work
Foreground = new SolidColorBrush(Colors.Blue),
//Doesn't work
ShowGridLines = false
//This works
//LabelRotationAngle = 90 //THIS WORKS if I enable it!
};
chart.PrimaryAxis = primaryAxis;
NumericalAxis secondaryAxis = new NumericalAxis()
{
LabelStyle = style,
//Doesn't work
//Foreground = new SolidColorBrush(Colors.Blue),
//Doesn't work
ShowGridLines = false //This works
};
chart.SecondaryAxis = secondaryAxis;
Please help because I have spent hours and hours trying to find a solution. I only want a code solution and not an XAML one because I don't create any charts in the UI. I just save the charts without showing them in the UI.