Reputation: 2376
For each of the int's in a list (mylist) I would like the following to be executed:
e.g.
// Add series and points
ramChart.Series["RAM"].Points.AddY(mylist[0]);
ramChart.Series["RAM"].Points.AddY(mylist[1]);
ramChart.Series["RAM"].Points.AddY(mylist[2]);
and so on until there it has gone through all of the list values
Upvotes: 0
Views: 126
Reputation: 5681
something like this:
for (i=0 .. mylist.size(){
ramChart.Series["RAM"].Points.AddY(mylist[i]);
}
perhaps use an iterator, but I dont really know c# syntax
edit: you can speed this process up by doing list concatenation instead of adding elements one by one
Upvotes: 0
Reputation: 245399
Do you mean something as simple as:
foreach(var i in mylist)
{
ramChart.Series["RAM"].Points.AddY(i);
}
Upvotes: 4