2011-02-02 70 views
1

如何从横向旋转轴文本垂直?WPF工具包图表旋转轴

我不能做到这一点通过XAML,因为我是一个动态创建多个系列,我不知道前面有多少则要到控制填充后。

enter image description here

我需要显示的日期垂直或倾斜,而不是HORZ。

再次感谢您。

+0

任何人有如何做到这一点的任何线索? – nitefrog 2011-02-09 04:16:01

回答

3

不知道你是否已经找到了这个答案,但在关闭的机会,你没有,你可以尝试以下方法:

这是XAML,但应该不管工作有多少系列你创建它是为了设计轴的样式。

 <chart:Chart.Axes> 
      <chart:DateTimeAxis Orientation="X" ShowGridLines="True"> 
       <chart:DateTimeAxis.AxisLabelStyle> 
        <Style TargetType="{x:Type chart:AxisLabel}"> 
         <Setter Property="StringFormat" Value="{}{0:d-MMM}" /> 
         <Setter Property="RenderTransformOrigin" Value="1,0.5" /> 
         <Setter Property="RenderTransform"> 
          <Setter.Value> 
           <RotateTransform Angle="-45" /> 
          </Setter.Value> 
         </Setter> 
        </Style> 
       </chart:DateTimeAxis.AxisLabelStyle> 
      </chart:DateTimeAxis> 

      <chart:LinearAxis ShowGridLines="True" /> 
     </chart:Chart.Axes>