按语:
在工程中出现了类似问题,经排查 以下两条语句,设置X轴字符串坐标标识会带来此问题,去掉即可。
//myPane.XAxis.Scale.TextLabels = coordList.ToArray(); //设置X轴坐标
//myPane.XAxis.Type = AxisType.Text;
-
//第1条曲线
-
PointPairList list1 = new PointPairList();
-
for (int i = 0; i < 36; i++)
- {
-
double x = i;
-
double y1 = 2*x + 1;
- list1.Add(x, y1);
- }
-
myCurve = zedGraphControl1.GraphPane.AddCurve("曲线1", list1, Color.Red, SymbolType.None);
-
//第2条曲线
-
PointPairList list2 = new PointPairList();
-
list2.Add(5, 11);
-
list2.Add(10, 40);
-
myCurve2 = zedGraphControl1.GraphPane.AddCurve("曲线2", list2, Color.Blue, ZedGraph.SymbolType.None);
-
//刷新
- zedGraphControl1.AxisChange();
- zedGraphControl1.Invalidate(); https://bbs.csdn.net/topics/397463077