title: How do I link a chart item to a datagridview in VB.net?
body: <p>I am trying to get my chart to display a column graph which gets the data from a datagridview, which is connected to an xml. I am not sure what to do exactly because there is nothing that is working.</p>
  <p>I tried using my friends code:</p>
  <pre><code>      'collects data from the XMl file &quot;Financial_PLanner&quot; then displays it onto a DataGrid 
      Dim MyXMlFile = &quot;Financial_Planner.xml&quot;
      If My.Computer.FileSystem.FileExists(MyXMlFile) = True Then
          DsFinancialPlanner.ReadXml(MyXMlFile)
      End If
  
      'Creats a Column Graph, The X-axis of the Graph is the Data of the first Column of the DataGrid, The Y-axis of the Graph is the Data of the Second Column of the DataGrid
      graFullGraph.Series(0).ChartType = DataVisualization.Charting.SeriesChartType.Column
      graFullGraph.Series(0).Points.Clear()
      For Count As Integer = 0 To DtabFinancialDetailsDataGridView.Rows.Count - 1
          graFullGraph.Series(0).Points.AddXY(DtabFinancialDetailsDataGridView.Item(0, Count).Value, DtabFinancialDetailsDataGridView.Item(1, Count).Value)
      Next
  </code></pre>
  <p>But it displays this error:
  System.ArgumentNullException: 'Value cannot be null.
  Parameter name: xValue'</p>
  <p>It would be great if someone could help out with this! Thank you!</p>