anyone know zedgraph here?

ss123

Member
Joined
Feb 25, 2006
Messages
14
Programming Experience
1-3
hv try the solution that you give to me and it works but the date on x-axis is start from 1900 where my date in db start from 2005. can it make it to start by 1/1/2005 follow by the date in db? Besides that, how can i set the zoom so that it only can zoom until day such as 2/01/2005

below is the code:

Dim myConnection As OleDbConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" & _
"DATA SOURCE=C:\Documents and Settings\Administrator\My Documents\Plantation.mdb;User Id='admin';Password='';")
Dim mySelectQuery As String = "SELECT Date,Last FROM Maxis"
Dim myCommand As New OleDbCommand(mySelectQuery, myConnection)
myConnection.Open()
Dim myReader As OleDbDataReader
myReader = myCommand.ExecuteReader()

Dim junk As ZedGraph.ZedGraphControl
junk = zgc
junk.GraphPane.Title = "Test Case for VB"
junk.IsShowPointValues = True
Dim x(100) As Double
Dim y(100) As Double
Dim i As Integer
' Randomize()


For i = 1 To 100
myReader.Read()
MessageBox.Show((myReader.GetDateTime(0)).ToOADate)
x(i) = (myReader.GetDateTime(0)).ToOADate
y(i) = myReader.GetDouble(1)
Next


junk.GraphPane.AddCurve("Sine Wave", x, y, Color.Blue, ZedGraph.SymbolType.XCross)
junk.GraphPane.AxisFill = New ZedGraph.Fill(Color.White, Color.LightGoldenrodYellow)
junk.AxisChange()
 
Back
Top