Plotting in MS Chart

I have been using VB 6 Black Book to design a UI and have gotten as far as outputting a textfile and generating numeric arrays from the text strings.  The next step will be to plot or chart selected arrays vs. each other( i.e time vs. distance, velocity, acceleration).  I am attempting to use MS Chart but will try Excel if all fails.  Can you offer a reference and/or sample code to set X and Y to specific data arrays?

I can parse a text output file into various arrays:
Dim NewLine As String
Dim MyString As String
Dim NewString As String
Dim LeftString As String
Dim Time() As Variant, Travel() As Variant, Velocity() As Variant, Acceleration() As Variant, Breech() As Variant, Mean() As Variant, Base() As Variant, Temp() As Variant, Burn1() As Variant, Burn2() As Variant, Burn3() As Variant, Burn4() As Variant, Burn5() As Variant
ReDim Time(10000), Travel(10000), Velocity(10000), Acceleration(10000), Breech(10000), Mean(10000), Base(10000), Temp(10000), Burn1(10000), Burn2(10000), Burn3(10000), Burn4(10000), Burn5(10000)
Dim i As Integer
Dim A As Integer

   Open "C:\Guns\Output.Out" For Input As #1
   Do Until LeftString = "(PSI)    (PSI)    (PSI)    (K)"
       Input #1, MyString
       LeftString = Left(MyString, 30)
   NewString = Mid(MyString, 37)
   i = 1
   Select Case NewString
       Case "1"
           Do Until MyString = "PROJECTILE EXIT"
               Input #1, MyString
               If (Left(MyString, 1)) = "0" Or (Left(MyString, 1)) = "1" Or (Left(MyString, 1)) = "2" Or (Left(MyString, 1)) = "3" Or (Left(MyString, 1)) = "4" Or (Left(MyString, 1)) = "5" Or (Left(MyString, 1)) = "6" Or (Left(MyString, 1)) = "7" Or (Left(MyString, 1)) = "8" Or (Left(MyString, 1)) = "9" Then
               Time(i) = (Val(Mid(MyString, 1, 7)))
               Travel(i) = (Val(Mid(MyString, 8, 7)))
               Velocity(i) = (Val(Mid(MyString, 15, 8)))
               Acceleration(i) = (Val(Mid(MyString, 23, 9)))
               Breech(i) = (Val(Mid(MyString, 32, 9)))
               Mean(i) = (Val(Mid(MyString, 41, 9)))
               Base(i) = (Val(Mid(MyString, 50, 9)))
               Temp(i) = (Val(Mid(MyString, 59, 7)))
               Burn1(i) = (Val(Mid(MyString, 66, 7)))
               i = i + 1
               End If
           A = i Mod 10000
               If A <> 0 Then
                   ReDim Preserve Time(A), Travel(A), Velocity(A), Acceleration(A), Breech(A), Mean(A), Base(A), Temp(A), Burn1(A), Burn2(A), Burn3(A), Burn4(A), Burn5(A)
               End If


Using Check boxes and Option buttons, I want to plot the Velocity, Accelration, Breech, and others against the time or travel array.  I have tried several attempts with MSChart similar to:
Dim rowLabelCount, columnLabelCount, rowCount As Integer
  Dim columnCount, labelIndex, Column, Row As Integer
  GRAPH.chartType = VtChChartType2dXY
  GRAPH.ChartData = Velocity
and a datagrid.

I am not familiar with the steps to go from array to chart and would very much appreciate some feedback.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Look at this code:

There is another example In Samples folder where you have installed your VB.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
RDXBrewerAuthor Commented:

was not what I was looking for....But the MSDS example seems close.  Some questions:

Do I have to input my arrays into a spreadsheet in order to plot them?

I can't seem to make arrays public in a form, do I need a module, and what is the difference between the two?

thanks for the feedback,
Graphs are graphical representation of arrays. Either you use arrays, or spreadsheets (they actually store arrays).

Why cant you make arrays public in a form? Simply declare the arrays in the declaration section and they are public.
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

RDXBrewerAuthor Commented:
My problem was much more complex than the Chart Sample, But it did send me in the right direction.

I appreciate the reference.

I have 500 more points for 2 more references:

1)Printing Options and Printing without Printform:  I have to print the graphs I have created along with a textbox summarizing the peaks.  I have created a form that is the preview I want to print.  Next I:

dim obj as printer
'change options
obj.print quality=-3
obj. ETC, ETC, ETC

Set obj as printer

Obviously, this is wrong...I need a simple working source code.

2)I need to export an array(size,6) into 6 columns in Excel.  I have not even begun to think about how to do this.  I would like to get a reference or two.

Let me know if you are interested in the points and I will post the question.

Thanks Again Sethi,

I can solve the first question as I myself am using a printing code to print MScharts with my applications.
RDXBrewerAuthor Commented:
Check out "Points for Sethi" Question.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.