I want implement rotation and interval of axis label on x axis with LinearAxis in code behind.
lineSeria = new LineSeries();
linAxis = new LinearAxis();
linAxis.Orientation = AxisOrientation.X;
linAxis.Location = AxisLocation.Bottom;
linAxis.Interval = 10;
var xLabel = new Style(typeof(AxisLabel));
var rotation = new Setter(AxisLabel.RenderTransformProperty, new RotateTransform() { Angle = -90, CenterX = 50, CenterY = 1 });
xLabel.Setters.Add(rotation);
linAxis.AxisLabelStyle = xLabel;
lineSeria.ItemsSource = drowMap[zoomedPointElem.Key];
lineSeria.DependentValuePath = "Value";
lineSeria.IndependentValuePath = "Key";
lineSeria.IndependentAxis = linAxis;
chart[coefficient].Series.Add(lineSeria);
I did this way but something i missed, got this problem "Assigned independent axis cannot be used. This may be due to an unset Orientation property for the axis." How can i fix it, need code behind please. Thank you