none
Why do my polar chart grid lines disappear when there is no data? RRS feed

  • Question

  • Hi there


    I have a Visual Basic application that reads data from a serial port and replicates direction and velocity. This is represented on a polar chart. When there is data for velocity, my chart shows grid lines with an angle and velocity. When the data values are zero, the grid lines disappear.


    Sorry, I am unable to provide screenshots or links for further explanation.

    Thanks in advance!

    Friday, July 26, 2019 10:49 AM

Answers

  • Hi,

    Public Class Form1
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            Chart1.Series(0).ChartType = DataVisualization.Charting.SeriesChartType.Polar
        End Sub
    
        Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
            Chart1.Series(0).Points.Add.IsEmpty = True
        End Sub
    End Class
    

    or code:

    Public Class Form1
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            Chart1.Series(0).ChartType = DataVisualization.Charting.SeriesChartType.Polar
        End Sub
    
        Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
            'Chart1.Series(0).Points.Add.IsEmpty = True
            Chart1.Series(0).Points.Add(0, 0)
        End Sub
    End Class
    

    Best Regards,

    Alex


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by DeanRowntree Monday, July 29, 2019 9:39 AM
    Monday, July 29, 2019 8:49 AM

All replies

  • Hi,

    Public Class Form1
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            Chart1.Series(0).ChartType = DataVisualization.Charting.SeriesChartType.Polar
        End Sub
    
        Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
            Chart1.Series(0).Points.Add.IsEmpty = True
        End Sub
    End Class
    

    or code:

    Public Class Form1
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            Chart1.Series(0).ChartType = DataVisualization.Charting.SeriesChartType.Polar
        End Sub
    
        Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
            'Chart1.Series(0).Points.Add.IsEmpty = True
            Chart1.Series(0).Points.Add(0, 0)
        End Sub
    End Class
    

    Best Regards,

    Alex


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by DeanRowntree Monday, July 29, 2019 9:39 AM
    Monday, July 29, 2019 8:49 AM
  • Thanks for the response Alex.

    I used a combination of the above to get what I wanted:

    If WindSpeed > 0 Then
       Chart4.Series(0).Points.Clear()
       Chart4.Series(0).Points.AddXY(0, 0)
       Chart4.Series(0).Points.AddXY(WindDirection, WindSpeed)
    Else if WindSpeed = 0 Then
       Chart4.Series(0).Points.Clear()
       Chart4.Series(0).Points.Add.IsEmpty = True
    End If

    Monday, July 29, 2019 9:41 AM