I have a two fold question as I have been struggling with this issue for a while now. I am using Visual Studio .NET 2003 Visual C++ Windows Forms. I can't find any real examples or help anywhere.
I want to have a CWGraph that can have up to 11 different plots simutaneously. I can make the first plot using the PlotY command as shown below:
double dataY __gc[] = new double __gc[163];
for (int i = 0; i < 163; ++i)
dataY[i] = i * 24.5;
GraphDefault->PlotY(dataY,S"5.8",S"0.1",S"true");
This works great for a single plot, but not of multiple plots.
I have the data for every plot that I need to make at runtime and can easily assemble it to whatever format it needs to be in to get PlotY to work. I have changed all the colors for each plot from within the properties portion for the CWGraph. All the examples I tend to find have something like this:
DefaultGraph.Plots.Item(index).PlotY( System::object __gc*,System::object __gc*,System::object __gc*,System::object __gc*);
But, I can't seem to get anything like that to work for VC++ .NET using Windows Forms. The compiler will compile something similar (using -> instead of .), but the program crashes when it attempts to run that line of code. From what I can tell, Windows Forms for Visual C++ syntax is really:
DefaultGraph->PlotY( param1, param2, param3, param4);
So I see no way to tell it which plot I want it to use.
From my understanding, you send a matrix to the PlotY and it will display all the different graphs for you at once. That is fine, but I can't figure out the structure for the matrix. All the header files I have for National Instruments have some sort of compile error and I can't compile any of them into my source, so I am unable to use the NiScalarMatrix for my matrix.
Part 2 of my question is being able to hide on plot (or several plots) by turning some sort of visibility property to false.
What I would eventually like to do is upon loading up a particular form, I would like to load all 11 plots to the CWGraph and make them all invisible. When the user checks a check box, I will display that current graph by making it visible. This way if they click on all the checkboxes for the various graphs, all will be displayed in various colors distiguishing them from each other and coordinating them with the checkbox checked.
Does anyone have any idea's for this? Is there any C# sourse that does this? I think I could successfully take C# code and translate it to C++ code, although I would prefer any type of help in the C++ arena.