Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

PlotXvsY/using CNiReal64vector

I have a histogrammed array of data and I want to plot
the values in this array on a simple graph. Which plot is best to use PlotY() or PlotXvsY?

I use a for loop and index thru the array(see prog). plotY doesnt produce the right values stored in the array, and plotXvsY complains about data types j-being an int and the array being an array of shorts.

Also how do I convert CNiString/CString into a character array?.
I am trying to use an Edit box to enter a filename at the beginning of my program, and store it into a char array.
Any tips?
Thanks
taniauto
0 Kudos
Message 1 of 2
(3,075 Views)
In general, PlotY is used when you want to specify custom y data vs. continuous and increasing x data and PlotXvsY is used when you want to specify custom y data vs. custom x data. As long as your x data can be specified by a starting value and a constant increment, PlotY should do the right thing and would be easier. Otherwise, you should use PlotXvsY. To make PlotXvsY work in your case, make both parameters CNiReal64Vector (or another Measurement Studio vector type if that's more appropriate) and it should work.

Regarding converting CNiString/CString into a character array, CString (and hence CNiString) defines an operator LPCTSTR member which will return a character pointer that lets you directly access the characters stored in the object as a C-style st
ring, so the answer is casting. If you need a non-constant pointer, use the GetBuffer method (don't forget to call ReleaseBuffer after you're finished making modifications to the string - see the docs for more info).

- Elton
0 Kudos
Message 2 of 2
(3,075 Views)