hi everybody,
i want to draw bar diagram in asp.net. but i cant able 2 proceed. i had found coding for this things in internet. the codes are as follows . can anyone clarify my doubt.
Dim objbitmap As New Bitmap(400, 200)
Dim objgraphics As Graphics
objgraphics = Graphics.FromImage(objbitmap)
objgraphics.Clear(Color.Gray)
objgraphics.DrawString("charts", New Font("Verdana", 12), Brushes.Black, New PointF(5, 5))
Dim myconnection As OleDbConnection
Dim connstring As String
Dim dred As OleDbDataReader
Dim mycommand As OleDbCommand
myconnection = New OleDbConnection(connstring)
myconnection.Open()
myconnection = New OleDbConnection("provider=microsoft.jet.oledb.4.0;data source = d:\database\reports.mdb")
Dim sqlstring As String
sqlstring = "SELECT count(items) as itemtotal,year as year FROM item"
mycommand = New OleDbCommand(sqlstring, myconnection)
dred = mycommand.ExecuteReader()
Do While dred.Read()
------------- upto this its ok, after this he has using itemtotal and i. wat it indicates. i cant able 2 understand. can anyone help me. --------
vivekgrs
Member
585 Points
117 Posts
graphs in asp.net
May 09, 2006 11:51 AM|LINK
hi everybody,
i want to draw bar diagram in asp.net. but i cant able 2 proceed. i had found coding for this things in internet. the codes are as follows . can anyone clarify my doubt.
Dim objbitmap As New Bitmap(400, 200)
Dim objgraphics As Graphics
objgraphics = Graphics.FromImage(objbitmap)
objgraphics.Clear(Color.Gray)
objgraphics.DrawString("charts", New Font("Verdana", 12), Brushes.Black, New PointF(5, 5))
Dim myconnection As OleDbConnection
Dim connstring As String
Dim dred As OleDbDataReader
Dim mycommand As OleDbCommand
myconnection = New OleDbConnection(connstring)
myconnection.Open()
myconnection = New OleDbConnection("provider=microsoft.jet.oledb.4.0;data source = d:\database\reports.mdb")
Dim sqlstring As String
sqlstring = "SELECT count(items) as itemtotal,year as year FROM item"
mycommand = New OleDbCommand(sqlstring, myconnection)
dred = mycommand.ExecuteReader()
Do While dred.Read()
------------- upto this its ok, after this he has using itemtotal and i. wat it indicates. i cant able 2 understand. can anyone help me. --------
objgraphics.FillRectangle(New SolidBrush(Color.Blue, (i * 35) + 15, 200 - dred(itemtotal), 20, dred(itemtotal) + 5))
objgraphics.DrawRectangle(Pens.Black, (i * 35) + 15, 200 - dred(itemtotal), 20, dred(itemtotal) + 5)
Loop
dred.close()
myconnection.close()
regards
m.arunachalam