Is there a VB.net way to clear/remove Vertical Line annotations?

20 views Asked by At

I am currently creating a fastpoint chart in VB.net that gives me a select amount of data from a .csv file. I have created a VerticalLineAnnotation to create a vertical line each time a specific value occurs. The issue I am having lies with removing the lines. I have a list box I am cycling through each listbox item populates a new graph. currently I am using .Clear() to remove the series in order to remove the previous data and plot the new data. I have tried doing the same with my VerticalLineAnnotation with absolute zero luck. This is what I have as of now.

If TotalCountsOfD000Files = 0 Then GoTo LLineZeroD000Files
For A As Interger = 0 To TotalCountsOfD000Files
    Dim VerticalLineD000 = New DataVisualization.Charting.VerticalLineAnnotation
    VerticalLineD000.AxisX = Hourly_Chart.ChartAreas(0).AxisX
    VerticalLineD000.IsInfinitive = True
    VerticalLineD000.ClipToChartArea = Hourly_Chart.ChartAreas(0).Name
    VerticalLineD000.LineWidth = 1 
    VerticalLineD000.X = D000VertLineAnnoDateTime(A).ToOADate()
    VerticalLineD000.LineColor = Color.black
    Hourly_Chart.Annotations.Ass(VerticalLineD000)
Next
LineZeroD000Files:
VerticalLineD000.Clear()
0

There are 0 answers