Hi all,
I'm developing a graphing application that plots several lines from a protein sequencer that outputs its values in .csv format.
I've read the csv into a DataGridView just fine, which is laid out like this:
Cycle | A1 | A2 | A3 (all the way up to A12, then again for each letter to H)
0 | XXXX | XXXX | XXXX
1 | XXXX | XXXX | XXXX
2 | XXXX | XXXX | XXXX
3 | XXXX | XXXX | XXXX
4 | XXXX | XXXX | XXXX
5 | XXXX | XXXX | XXXX
cycle goes down to 180
I want to plot a line graph from, say, just Cycle and A2.
Is there a way for me to specify in VB.NET for Chart Control to only plot from these two columns e.g.
Chart1.Series("Series1").Points.PlotXY(Column1, Column3) ?
Cheers guys!!
Here's the code I used to read in the csv, the file is C:\test.csv
Imports System.Data
Imports System.Data.OleDb
Imports System.Windows.Forms.DataVisualization.Charting
Public Class Form1
Inherits System.Windows.Forms.Form
Dim objDataset1 As DataSet()
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Imports the csv into the datagridview
Dim sConnectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\;Extended Properties=Text;"
Dim objConn As New OleDbConnection(sConnectionString)
objConn.Open()
Dim objCmdSelect As New OleDbCommand("SELECT * FROM dude.csv", objConn)
Dim objAdapter1 As New OleDbDataAdapter()
objAdapter1.SelectCommand = objCmdSelect
Dim objDataset1 As New DataSet()
objAdapter1.Fill(objDataset1, "Test")
DataGridView1.DataSource = objDataset1.Tables(0).DefaultView
objConn.Close()
End Sub
End Class