Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Cwgraph starting point

11 views
Skip to first unread message

hrsnblm

unread,
Jul 29, 2008, 11:10:07 AM7/29/08
to
When generating a plot using CWGraph, I have found that even though the array that holds my data starts at index '1', CWGraph wants to continually start my plot at '0'. If I set the minimum value to '1', then I lose the first piece of data. Why is this? How can I start my CWGraph plot at '1' with the first piece of data as I believe it should?
 
Also, I seem to be unable to find a detailed description of the optional parameters for CWGraph.PlotY.
 
Thanks ahead of time for any and all assistance.

Dr. Doiron

unread,
Jul 31, 2008, 2:40:09 AM7/31/08
to
Hello Hrsnblm,
 
What exactly do you mean why "the array that holds my data starts at index '1'", could you please post how you have your array declared and how you are using CWGraph?
 
As for your question regarding the options for CWGraph.PlotY, this can be found in the Measurement Studio Help.
 
I set up a simple example that declared an array and plots it and I did not encounter the same behavior as you, please post a snippet of your code so I can assist further.

hrsnblm

unread,
Jul 31, 2008, 8:40:09 AM7/31/08
to
   When I first started using CWGraph I noticed that the x-axis started at '0'. I tried to keep my data uniform in how the arrays were utilized, starting them at '1' so that I didn't have to compensate for counts. When I shifted the beginning of the x-axis to '1', it was then I noticed that the display would then drop the first piece of data and start with the second. I tried a couple of different manipulations to get the display to start at '1' on the x-axis and have the graph start at the correct piece of data.
Thank you for your assistance.
*********************************************************************
 '// build array for graph display eliminating empty indexes and keep track of # of empty indexes    Do While (i <= TotalDays)        If chData(i) <> "" Then            tempchData(j) = chData(i)            i = i + 1            j = j + 1        Else            EmptyCells = EmptyCells + 1            i = i + 1        End If
    Loop
    '// Find the lowest value for setting minimum y-axis   Dim k As Integer        For k = 1 To (TotalDays - EmptyCells)            tempValue = CSng(tempchData(k))            If lwrValue > tempValue Then                lwrValue = tempValue            End If
        Next k
    '// Find the highest value for setting maximum y-axis    Dim l As Integer        tempValue = 0        For l = 1 To (TotalDays - EmptyCells)            tempValue = CSng(tempchData(l))            If uprValue < tempValue Then                uprValue = tempValue            End If
        Next l
        'If pass rate data selected    If optPass.Value = True Then        CWRateData.Axes.Item(2).Minimum = Format(lwrValue, "##.0") - 10        CWRateData.Axes.Item(2).Maximum = 100
    Else             'If fail rate data selected            If optFail.Value = True Then            CWRateData.Axes.Item(2).Minimum = 0            CWRateData.Axes.Item(2).Maximum = Format(uprValue, "##.0") + 10            Else                 'If total processed selected                If optTotalRun = True Then                    CWRateData.Plots(1).LineStyle = cwLineStep

Dr. Doiron

unread,
Jul 31, 2008, 9:40:25 AM7/31/08
to
Hello hrsnblm,
It looks like the xFirst optional parameter of CWGraph.PlotY is what you are looking for, you don't even need to have to mess with the array indexing.
Here's an example:
dim data[3] as int
data[0]=0
data[1]=1
data[2]=2
data[3]=3
CWGraph.PlotY data, 1
 
This will show you the 4 data points with an x min value of 1.

hrsnblm

unread,
Jul 31, 2008, 9:40:26 AM7/31/08
to
Thank you. This seems to have corrected my problem. I do have a question to hopefully understand why this worked this way. According to the Measurement Studio Help files, setting the x-axis can be done either by one of the twof ollowing settings:
CWRateData.Axes.Item(1).Minimum = 0   
0 new messages