Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
141145 | Nov 27,2018 04:56 AM UTC | Nov 28,2018 09:55 AM UTC | WPF | 5 |
![]() |
Tags: SfChart |
<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
|
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.