Winform统计画图,在MasterPane 中添加多个GraphPane ,第一次运行是字体现实正常,但是在第二次之后自己就变小了,
不知道是什么原因(添加多个GraphPane时才出现这种情况),下面是主要的代码,求高人指点: ZedGraph.ZedGraphControl zed = new ZedGraph.ZedGraphControl();
zed.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom;
Pl1.Controls.Add(zed);
zed.Dock = DockStyle.Fill;
MasterPane myMaster = zed.MasterPane;
for(int i=0;i<3;i++)
{
GraphPane myPane = new GraphPane(new Rectangle(40, 40, 600, 400),"",xTitle, "数量");
myPane.BaseDimension = 15;
...
myMaster.Add(myPane);
} // Tell ZedGraph to auto layout all the panes
using (Graphics g =zed.CreateGraphics())
{
// myMaster.SetLayout(g, false, new int[] { 1,2}, new float[] {2,1});
myMaster.IsCommonScaleFactor = true;
myMaster.SetLayout(g,r,1);
myMaster.AxisChange(g);
}
不知道是什么原因(添加多个GraphPane时才出现这种情况),下面是主要的代码,求高人指点: ZedGraph.ZedGraphControl zed = new ZedGraph.ZedGraphControl();
zed.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom;
Pl1.Controls.Add(zed);
zed.Dock = DockStyle.Fill;
MasterPane myMaster = zed.MasterPane;
for(int i=0;i<3;i++)
{
GraphPane myPane = new GraphPane(new Rectangle(40, 40, 600, 400),"",xTitle, "数量");
myPane.BaseDimension = 15;
...
myMaster.Add(myPane);
} // Tell ZedGraph to auto layout all the panes
using (Graphics g =zed.CreateGraphics())
{
// myMaster.SetLayout(g, false, new int[] { 1,2}, new float[] {2,1});
myMaster.IsCommonScaleFactor = true;
myMaster.SetLayout(g,r,1);
myMaster.AxisChange(g);
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货