Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

XY graph with independent plots (like LabVIEW)

The ScatterGraph doesn't seem to handle completely independent x axes per y axis like LabVIEW does. What's the best way to make a graph with five plots like the one in the attached pic?
0 Kudos
Message 1 of 3
(3,778 Views)
Hello,

I'm not quite sure what you mean by the axis not being independent.  One of the ScatterGraph's properties is the collection of Plots.  You can create new ScatterPlots and specify their x and y axis, and their x and y data points. I modified the VB XYGraph example to graph independent plots.  This example is installed by default to:
C:\Documents and Settings\All Users\Documents\National Instruments\MStudioVS2005\DotNET\Examples\UI\WindowsForms\Graph\XYGraph\VB

This example allows you to plot different shapes.  Each time it changes the data in the plot, I changed it to instead create a new plot every time and add it to the collection of plots.  So, in each function for plotting a shape there is a line that says:

xyPlot.PlotXY(dataX, dataY);

which I changed to:

Dim newPlot As NationalInstruments.UI.ScatterPlot = New NationalInstruments.UI.ScatterPlot(xyPlotXAxis, xyPlotYAxis)
newPlot.PlotXY(dataX, dataY)
xyDataScatterGraph.Plots.Add(newPlot)

To get it to do what I think you are wanting to do. 

Let me know if you have any questions, or that's not quite what you are wanting to do.



Message Edited by KristenC on 03-28-2008 10:54 AM
Kristen
National Instruments
0 Kudos
Message 2 of 3
(3,745 Views)
That shows me how to do it, thanks. I didn't know what Collections were and about their Add method.
0 Kudos
Message 3 of 3
(3,740 Views)