我试图用不同的颜色绘制几条曲线,但它不起作用。即使我验证了颜色部分已更改,我仍继续为所有人获得相同的颜色。我什至已经手动完成了。
我有另一个创建 PointPairList List 的类和另一个改变颜色的类。
myPane = zedGraphControl1.GraphPane;
int index = 0;
foreach (PointPairList item in cMasterGraph)
{
myPane = zedGraphControl1.GraphPane;
// GraphPane object holds one or more Curve objects (or plots)
myPane.YAxis.Type = AxisType.Log;
Color color = GetNextColor();
// Add cruves to myPane object
LineItem myCurve = myPane.AddCurve(cGraphname[index], item, color, SymbolType.None);
LineItem myCurve2 = myPane.AddCurve(cGraphname[index], item, Color.Yellow, SymbolType.None );
//myCurve.Add(tempcurve);
myCurve.Line.Width = 1.0F;
index++;
//myCurve.IsSelected = true;
// I add all three functions just to be sure it refeshes the plot.
zedGraphControl1.AxisChange();
zedGraphControl1.Invalidate();
zedGraphControl1.Refresh();
}
我已经被困在这个问题上太久了。