|
<chart:SfChart.Annotations>
<chart:VerticalLineAnnotation X1="2" Stroke="DarkGray" StrokeThickness="5">
<chart:VerticalLineAnnotation.ContentTemplate>
<DataTemplate>
<StackPanel >
<TextBlock Text="Title 1" Margin="0,-50,0,0">
<TextBlock.RenderTransform>
<RotateTransform Angle="90"/>
</TextBlock.RenderTransform>
</TextBlock>
<TextBlock Text="Title 2" Margin="0,50,0,0" >
<TextBlock.RenderTransform>
<RotateTransform Angle="90"/>
</TextBlock.RenderTransform>
</TextBlock>
</StackPanel>
</DataTemplate>
</chart:VerticalLineAnnotation.ContentTemplate>
</chart:VerticalLineAnnotation>
</chart:SfChart.Annotations> |
|
<chart:TextAnnotation Text="Title 1" X1="1.5" Y1="57" Angle="90"/> |
I am still using the VerticalLineAnnotation though. For instance:<code>VerticalLineAnnotation currentAnnotation = new VerticalLineAnnotation(){X1 = viewModel.CardTimestamps.ElementAt(i),Text = viewModel.DebriefCards.ElementAt(i).CardTitle,HorizontalTextAlignment = HorizontalAlignment.Right,Stroke = new SolidColorBrush(Colors.Black),StrokeThickness = 4,Opacity = 0.2,};//currentAnnotation.ContentTemplate = template;waveformsGraph.Annotations.Add(currentAnnotation);if(i > 0){VerticalLineAnnotation previousAnnotation = new VerticalLineAnnotation(){X1 = viewModel.CardTimestamps.ElementAt(i),Text = viewModel.DebriefCards.ElementAt(i-1).CardTitle,HorizontalTextAlignment = HorizontalAlignment.Left,Stroke = new SolidColorBrush(Colors.Black),StrokeThickness = 4,Opacity = 0.2 ,};//previousAnnotation.ContentTemplate = template;waveformsGraph.Annotations.Add(previousAnnotation);</code>Is it possible to rotate this text?(Sorry not sure how to format as code)