日期:2014-05-17 浏览次数:20887 次
private void Form1_Load(object sender, EventArgs e) { MasterPane master = zedGraphControl1.MasterPane; master.Fill = new Fill(Color.White, Color.FromArgb(220, 220, 255), 45.0f); master.PaneList.Clear(); master.Title.IsVisible = true; master.Title.Text = "感光电压曲线图"; master.Margin.All = 10; master.InnerPaneGap = 0; ColorSymbolRotator rotator = new ColorSymbolRotator(); for (int j = 0; j < 3; j++) { GraphPane myPaneT = new GraphPane(new Rectangle(40, 40, 500, 250), "Case #" + (j+1).ToString(), "时间", "电压"); myPaneT.Fill.IsVisible = false; myPaneT.Chart.Fill = new Fill(Color.White, Color.LightYellow, 45.0F); myPaneT.BaseDimension = 2.0F; myPaneT.XAxis.Title.IsVisible = false; myPaneT.XAxis.Scale.IsVisible = false; myPaneT.Legend.IsVisible = false; myPaneT.Border.IsVisible = false; myPaneT.Title.IsVisible = false; myPaneT.XAxis.MajorTic.IsOutside = false; myPaneT.XAxis.MinorTic.IsOutside = false; myPaneT.XAxis.MajorGrid.IsVisible = true; myPaneT.XAxis.MinorGrid.IsVisible = true; myPaneT.XAxis.Scale.Max = 50; myPaneT.XAxis.Scale.Min = 0; myPaneT.Margin.All = 0; LineItem myCurve = null; if (j == 0) { myPaneT.YAxis.Scale.MinorStep = 0.1; myPaneT.YAxis.Scale.MajorStep = 1; myPaneT.YAxis.Scale.Max = 5; myPaneT.YAxis.Scale.Min = 0; myPaneT.Margin.Top =0; myPaneT.YAxis.Title.Text = "I1"; myCurve = myPaneT.AddCurve("Step " + j.ToString(), listI1, rotator.NextColor, SymbolType.None); myCurve.Line.StepType = StepType.ForwardStep; myCurve.Symbol.Fill = new Fill(Color.Red); master.Add(myPaneT); this.zedGraphControl1.AxisChange(); } if(j==1) { myPaneT.YAxis.Scale.MinorStep = 0.1; myPaneT.YAxis.Scale.MajorStep = 1; myPaneT.YAxis.Scale.Max = 5; myPaneT.YAxis.Scale.Min = 0; myPaneT.XAxis.Scale.MinorStep = 1; myPaneT.Margin.Top = 0; myPaneT.YAxis.Title.Text = "I2"; myCurve = myPaneT.AddCurve("Step " + j.ToString(), listI2, rotator.NextColor, SymbolType.None); myCurve.Symbol.Fill = new Fill(Color.Red); master.Add(myPaneT); this.zedGraphControl1.AxisChange(); } if (j == 2) { //myPaneT.YAxis.Scale.Max = files.ReadInteger("SYSTEM", "DISPLAY_VOLTAGE2", 5); //myPaneT.YAxis.Scale.Min = files.ReadInteger("SYSTEM", "DISPLAY_VOLTAGE1", -5); myPaneT.XAxis.Title.IsVisible = true; myPaneT.XAxis.Scale.IsVisible = true; myPaneT.XAxis.Scale.MinorStep = 1; myPaneT.Margin.Top =0; myPaneT.YAxis.Title.Text = "I3"; myCurve = myPaneT.AddCurve("Step " + j.ToString(), list, ro