Is there any way to rotate the independent value axis

Jul 9, 2009 at 8:26 PM

I have been working with the chart over that last few days and ran into a problem, I would like to rotate the independent value axis label.  The image in the link show's the labels are stacked what I would like is to be able to rotate these about 45 degrees and so they line up a little nicer.  I have been able to rotate the DependentRangeAxis but I have been unable to do this with the independent axis.  This seems to be a problem only when the independent values are datetime objects


Jul 10, 2009 at 10:15 PM

Something like the following seems to do the trick for me:

<charting:Chart x:Name="chart">
                    <Style TargetType="charting:AxisLabel">
                        <Setter Property="LayoutTransform">
                                <RotateTransform Angle="-45"/>

chart.DataContext = new KeyValuePair<DateTime, int>[]
    new KeyValuePair<DateTime, int>(DateTime.Today.AddDays(-7), 1),
    new KeyValuePair<DateTime, int>(DateTime.Today.AddDays(0), 2),
    new KeyValuePair<DateTime, int>(DateTime.Today.AddDays(7), 3),
Jul 14, 2009 at 8:37 PM

That works to rotate the axis labels, but the position of the labels is still "stacked" (in 2 rows).   Like this:

Is it possible to make it look like the photoshopped sample?