I'd like to populate a Zedgraph Pane with multiple graphs from a listbox with multiple curves. My method currently populates these curves, but they all have the same color and symbol type. Any suggestions on having each added curve be assigned a different color?
public void btnMakePlt_Click(object sender, EventArgs e)
{
try
{
// Initialize graph window
GraphPane myPane = zgcMain.GraphPane;
// clear plt
myPane.CurveList.Clear();
zgcMain.Refresh();
// Use this foreach to plot curves in the Selected Curves Listbox
foreach (var item2 in lstSelectedCurves.Items)
{
// turn CurveName into String
txtCurve = item2.ToString();
//Invoke IPmathCurveMethods, populate List
PointPairList list = new PointPairList();
double[] CurveDataVal = PlotIPdataStuffValues(txtCurve);
double[] CurveDataDepth = PlotIPdataStuffDepths(txtCurve);
for (int i = 0; i < CurveDataVal.Length; i++)
{
double z1 = CurveDataDepth[i];
double z2 = CurveDataVal[i];
if (z2 <= 0)
{
z2 = double.NaN;
}
//add to list
list.Add(z2, z1);
}
LineItem myCurve = myPane.AddCurve(txtCurve, list, Color.Red, SymbolType.None);
zgcMain.Refresh();
}
}
catch (Exception ex)
{
MessageBox.Show("Error making your plot \n" + ex.Message + "\n" + ex.StackTrace);
}
}