簡述
製作曲線時,Y軸標籤需要垂直顯示。只需將TextBlock 或 Label 的Layout旋轉90°或270°即可。
代碼
<TextBlock x:Name="TbYAxis" Canvas.Left="10" Canvas.Top="50" FontSize="20" Foreground="White" Text="Y軸">
<TextBlock.LayoutTransform>
<RotateTransform Angle="270"></RotateTransform>
</TextBlock.LayoutTransform>
</TextBlock>
<Label x:Name="LbYAxis" Canvas.Left="50" Canvas.Top="50" FontSize="20" Foreground="White" Content="Y軸" Padding="0">
<Label.LayoutTransform>
<RotateTransform Angle="90"></RotateTransform>
</Label.LayoutTransform>
</Label>