One way that you could do it would be to make sure that there's as many plots in the graph as there are items in your ArrayList, then loop through the ArrayList and plot the data. For this example, I will assume that your ArrayList is called list and the GraphData class has a GetData() method that returns an array of doubles that can be plotted:
// First make sure that the graph has enough plots for the data.
if (list.Count > graph.Plots.Count)
{
int plotsToAdd = list.Count - graph.Plots.Count;
for (int i = 0; i < plotsToAdd; ++i)
graph.Plots.Add(new WaveformPlot());
}
// Now loop through the list and plot the data one item at a time.
for (int i = 0; i < list.Count; ++i)
{
GraphData item = list[i] as GraphData;
if (item != null)
{
double[] data = item.GetData();
graph.Plots[i].PlotY(data);
}
}
If all of your data in the ArrayList is the same size, another option would be to create a two-dimensional double array, populate it from your list, then pass the two-dimensional array to PlotYMultiple. The first option above is probably easier, though.
- Elton