我在用ZedGraph。
我有两条曲线要画,第一条曲线是基于YAxis的尺度,第二条曲线是基于Y2Axis的,第一条曲线的值远大于第二条曲线。在我的项目中,这两条曲线都是基于YAxis的,这使得图形变得丑陋。
有没有人有基于Y2Axis绘制第二条曲线的经验?
这是我的代码:(我应该更改什么?)
PointPairList p1 = new PointPairList(),
p2 = new PointPairList();
//code to add data into p1 and p2
GraphPane gp = new GraphPane();
gp.AddCurve(p1, "", Color.Black);
gp.AddCurve(p2, "", Color.Blue);
gp.XAxis.Scale.Min = v1;
gp.Y2Axis.Scale.Max = v2;
gp.AxisChange();
gp.XAxis.Scale.IsUseTenPower = false;
gp.Y2Axis.Scale.IsUseTenPower=false;谢谢。
如果我想设置Y2Axis共享相同的Y1Axis网格,请在以下之后:
LineItem curveY2 = gp.AddCurve(p2, "", Color.Blue);..。
curveY2 .IsY2Axis = true;也就是说,网格是基于Y1Axis的,那么Y2Axis具有相同的网格,但具有不同的层位。例如,Y1Axis是从1到300,有7行,但是Y2Axis有1到20,我希望Y2Axis也有7行(与Y1Axis相同),我应该使用哪个函数?
发布于 2011-11-03 07:24:30
LineItem curveY2 = gp.AddCurve(p2, "", Color.Blue);
...
curveY2 .IsY2Axis = true;
//If you have more than one axis on the related side, you have to assign the index of the axis
curveY2 .YAxisIndex = 0;https://stackoverflow.com/questions/7987746
复制相似问题