Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

How to plot data using PlotXvsY method from the AxCWGraph object?

Hi Elton,

I  apologize for asking so many questions, but I really need to figure this one out. It appears that I need to liscence the ScatterGraph object or any ActiveX controls I have. I read up on the help file and it says I just need to re add all my reference files. I did just that , but it still asks that I need to liscence it when I run my program.

Any Ideas on how to liscence it properly?

0 Kudos
Message 11 of 13
(1,340 Views)
Hi,
 
I have found the article regarding to my problem, and fixed it. Again, I apologize for multiple posting, and answering it myself. But this one I can not answer myself.
 
I am trying to use plotXY, and my graph is not plotting any data. Here is a test code I am running just to teach myself how to use it.
 

double

values __gc[] = new double __gc[6];

double values2 __gc[] = new double __gc[6];

int x;

for(x=0; x<6; x++)

{

values[x] = x+2;

values2[x] = x+3;

scatterGraph1->PlotXY(values[x], values2[x]);

}

 

What is wrong with the logic of the above code?

0 Kudos
Message 12 of 13
(1,338 Views)
chowchow2469,

You need to move the PlotXY call outside the loop. PlotXY clears old data before plotting new values. Since your PlotXY call is inside the loop with a single data value as the argument, the scatter graph will plot a single point for each iteration of the loop. When you move the PlotXY call outside the loop and pass the entire values and values2 array, you will see all your data displayed on the graph.

If you would like to add points to an existing set of data displayed on the graph, then you can call PlotXYAppend. PlotXYAppend does not clear the old data before plotting. It only adds to the existing data points displayed on the graph.

Abhishek Ghuwalewala | Measurement Studio | National Instruments
0 Kudos
Message 13 of 13
(1,332 Views)