Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
475
How do I clear chart data for a re-plot?
posted

I have a panel where the user selects a date range for data to plot on a scatter chart and presses a command button to refresh the chart. Once I have show data for the first time the chart does not want to clear to show new data, it always shows the original data and does not refresh. How do I get it clear its old data and show the new. Here is what I have tried.

            Dim gSeries As Infragistics.UltraChart.Resources.Appearance.NumericTimeSeries
            chartData.DataBindings.Clear()
            chartData.Series.Clear()
            chartData.BeginInit()
            While stk.Count > 0
                rw = stk.Pop
                If fGetSQLData(dtStartDate.Value, dtEndDate.Value, rw("CustId"), cboProduct.Value, cboGraphVal.Text) Then
                    '== Check to see if there was any actual data for this customer
                    If tblSQLData.Rows.Count = 0 Then
                        MsgBox(rw("CustName") & " did not contain any data within the date range you selected", MsgBoxStyle.Information, "No Data For Customer")
                    Else
                        gSeries = New Infragistics.UltraChart.Resources.Appearance.NumericTimeSeries
                        gSeries.DataBind(tblSQLData, "Date", cboGraphVal.Text)
                        chartData.Series.Add(gSeries)
                    End If
                End If
            End While
            chartData.DataBind()
            chartData.EndInit()
            chartData.Visible = True

Parents
No Data
Reply
  • 475
    Verified Answer
    posted

    Change this...

      chartData.DataBindings.Clear()
      chartData.Series.Clear()

    To This...

      chartData.DataSource = Nothing
      chartData.Series.Clear()

Children
No Data