Results 1 to 2 of 2

Thread: creating a line graph

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2000
    Posts
    31
    I am trying to create a (single) line graph by plotting points from a 2d array. This following code is within a Private Sub Command1_Click() where the values within the arrays' are calculated also. It gives me q number of lines rather than a single line plotted from q number of points.

    Should I use a scatter graph instead?

    Thanks in advance

    Dim Data() As Double

    ReDim Data(1 To 2, q) As Double

    q = 1

    Do Until q = p

    Data(1, q) = voltageClampArray(23, q) 'time
    Data(2, q) = voltageClampArray(7, q) 'current

    q = q + 1

    Loop

    'plot data
    With MSChart1

    .Plot.Axis(VtChAxisIdX).CategoryScale.Auto = True
    .Plot.Axis(VtChAxisIdX).CategoryScale.DivisionsPerTick = q / 10
    .Plot.SeriesCollection(1).Position.Excluded = True 'hide time data
    .chartType = VtChChartType2dLine
    .ChartData = Data()

    End With

    'check values in array are correct
    q = 1
    Do Until q = p
    Print Data(2, q)
    q = q + 1
    Loop








  2. #2

    Thread Starter
    Junior Member
    Join Date
    Aug 2000
    Posts
    31

    re

    Please help!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width