Question
C# chart rotate labels
I have a simple chart, and I'd like the labels on the x-axis to be rotated 45 degrees. What am I doing wrong?
Chart c = new Chart();
c.ChartAreas.Add(new ChartArea());
c.Width = 200;
c.Height = 200;
Series mySeries = new Series();
mySeries.Points.DataBindXY(new string[] { "one", "two", "three" }, new int[] { 1, 2, 3 });
mySeries.LabelAngle = 45; // why doesn't this work?
c.Series.Add(mySeries);
The output is:
I'm using the charting stuff from System.Web.UI.DataVisualization.Charting.
21 40253
21