Click to See Complete Forum and Search --> : How to draw the Graph using VB?


Vivien Lee
January 17th, 1999, 09:32 PM
Hi,

I have a problem as I do not know how to create a graph chart using VB. I have collected my data. How can I make use of these data that I collected to draw the graph. Pls share with me the way to do this. Basically I know that I know that I may have to use the MSCHART control or the Microsoft Graph 5.0. But I do not know how to do so.


Thanks for reading and helping.


Vivien Lee

Girish
January 18th, 1999, 10:03 AM
As you told you have to use MSChart ActiveX control. MSchart control has got some properties that I will list down here.


Rows - No of Items in Y Axis

Columns - No of Items in X axis.

Column - Currently selected X axis element

row - Currentlt selected Y axis element.


You try the following code in your system


Place a MSChart Control in your form.

Rename MSChart1 to MyGraph.

Place a Command Button and rename as Submit


Dim rows as integer, cols as integer

Dim array(10) as integer

Dim counter as integer


Private Sub Form_activate()

rows = 5

cols = 10

counter = 0

MyGraph.rows= rows

MyGraph.Columns = cols

for counter = 0 to 10 step 1

array(counter) = 10 * counter

next

End Sub


Private Sub Submit_Click()

for counter = 0 to 10

Mygraph.row = counter

Mygraph.Column = counter '( Row 1, Column 1)

Mygraph.data = array(counter)

next

end Sub


You make changes as per your needs....


Wish you all the Best

Girish.S.

Project Manager

GuildSoft Pvt. Ltd.

Girish
January 18th, 1999, 10:23 AM
Important.......

------------------------+

Instead of Columns and Rows you use RowCount and ColumnCount