Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Problem with "Assigned independent axis cannot be used. This may be due to an unset Orientation property for the axis." in wpf chart c#

$
0
0

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


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>