08-06-2009 02:23 PM
Ok in VB6 i used ChartXvsY in the following manner
Dim XValue() as single
Dim YValue() as single
dim Counter as interger=0
when the user selected certain things to track i redimed YValue as a two dementional array as follows
redim YValue( #of itemes checked,0)
i would take a reading sample that looked like this
Sub Get readings
Xvaule(Ubound(XVaulue)) = Read X Data
if Channel1 selected then
YValue(Counter,0)= data for that channel
Counter=Counter +1
end if
if Channel2 selected then
YValue(Counter,0)= data for that channel
Counter=Counter +1
end if
ect for the rest of the channels
i then graphed the data in the following manner
Graph.ChartXvsY(ubound(Xvalue), YValue)
redim preserve Xvaule(ubound(Xvaule)+1)
Counter=0
end sub
In VB.net 2008 i used a Structure for my data channels as follows
Structure DataRtn
Public Ch1 as single
public Ch2 as single
ect for the rest of the channels
end Structure
then Dim PlotData(2500) as DataRtn so i have a 2500 array of DataRtn with all my channels within i.e a multidimetional Array
Now to Get the Readings i use the following
Sub Get Readings
if Ch1 is selected then
Plotdata(Cntr).Ch1= Data for that channel
end if
if Ch2 is selected then
Plotdata(Cntr).Ch2= Data for that channel
end if
ect for the rest of the channels
end sub
to plot the data i was trying this method
Graph.ChartXvsY(Plotdata(Cntr).Ch1, PlotData(Cntr))
this does not work, i have checked the forums on this matter and tried the methods they sugested but to no avail. If some one can help or point me in the right direction that would be great. Thanks
08-07-2009 09:44 AM
dwillis,
What about that code does not work, do you get error messages, unexpected behavior, or something else? You gave some code but what are you trying to accomplish? Can you point me to some of the articles that you've based this code off of, and describe which part of their code doesn't work? In the future please use the paste to code option when mixing code and text, it makes things much easier to understand