<chart:SfChart.SecondaryAxis>
<chart:NumericalAxis chart:ChartBase.RowSpan="3"
Visibility="Collapsed" Name="secondaryAxis"/>
</chart:SfChart.SecondaryAxis> |
YAxisPrice = New CustomLogarithmicYAxis
YAxisPrice.Name = "YAxisPrice"
YAxisPrice.LogarithmicBase = LogBase
YAxisPrice.FontSize = 12
YAxisPrice.ShowGridLines = False
YAxisPrice.Header = "Price"
..
Sub Annotations()
For i = 0 To BaseTicker.Minutes.Count - 1
If BaseTicker.Minutes(i).DateTime.TimeOfDay = TimeSpan.Parse("09:30:00") Then
Dim newVerticalLineAnnotation As New VerticalLineAnnotation
With newVerticalLineAnnotation
.CoordinateUnit = CoordinateUnit.Axis
.XAxisName = XAxis.Name
' .YAxisName = YAxisPrice.Name
.X1 = i
.StrokeThickness = 1
.ShowLine = True
.YAxisName = "secondaryAxis"
.Stroke = New SolidColorBrush(Colors.Yellow)
.ShowAxisLabel = False
.EnableClipping = False
End With
chart.Annotations.Add(newVerticalLineAnnotation)
End If
Next |
'Annotation Series with Axis
YAxisAnnotation = New NumericalAxis
YAxisAnnotation.Name = "YAxisAnnotation"
YAxisAnnotation.ShowGridLines = False
YAxisAnnotation.Visibility = Visibility.Collapsed
SfChart.SetRow(YAxisAnnotation, 0) 'row starts from 0 at the bottom
SfChart.SetRowSpan(YAxisAnnotation, 3) 'row ends to 3rd row at the top
With AnnotationSeries
.YAxis = YAxisAnnotation
End With
chart.Series.Add(AnnotationSeries)
End Sub
Sub Annotations()
For i = 0 To BaseTicker.Minutes.Count - 1
If BaseTicker.Minutes(i).DateTime.TimeOfDay = TimeSpan.Parse("09:30:00") Then
Dim newVerticalLineAnnotation As New VerticalLineAnnotation
With newVerticalLineAnnotation
.CoordinateUnit = CoordinateUnit.Axis
.XAxisName = XAxis.Name
.YAxisName = "YAxisAnnotation"
.X1 = i
.StrokeThickness = 1
.ShowLine = True
.Stroke = New SolidColorBrush(Colors.Yellow)
.ShowAxisLabel = False
.EnableClipping = False
End With
chart.Annotations.Add(newVerticalLineAnnotation)
End If
Next
End Sub
|