示例#1
0
 private void butApply_Click(object sender, EventArgs e)//应用
 {
     try
     {
         butApply.Enabled = false;
         ZedG.SelTream.ListYAxisGroup.Clear();
         for (int i = 0; i < dGV1.RowCount; i++)
         {
             if (dGV1.Rows[i].Cells[0].Value == null)
             {
                 continue;
             }
             string str0 = dGV1.Rows[i].Cells[0].Value.ToString();
             if (str0.Substring(0, 1) == "第")
             {
                 int           j     = Convert.ToInt32(str0.Substring(1, 1));
                 CLSYAxisGroup cCurG = new CLSYAxisGroup(dGV1.Rows[i].Cells[1].Value.ToString());
                 cCurG.FontColor = dGV1.Rows[i].Cells[2].Style.BackColor;
                 ZedG.SelTream.ListYAxisGroup.Add(cCurG);
             }
             else
             {
                 int j = Convert.ToInt32(str0);
                 ListCur[j - 1].Text      = dGV1.Rows[i].Cells[1].Value.ToString();
                 ListCur[j - 1].LineColor = dGV1.Rows[i].Cells[2].Style.BackColor;
                 ZedG.SelTream.ListYAxisGroup[ZedG.SelTream.ListYAxisGroup.Count - 1].ListCur.Add(ListCur[j - 1]);
             }
         }
         SaveToXML();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
示例#2
0
文件: CLSChart.cs 项目: tomyqg/SemiGC
        private void SetYAxis(Y2Axis yAxis3, FontSpec YTitle, FontSpec YScale, CLSYAxisGroup cCur)
        {
            try
            {
                yAxis3.Title.Text           = cCur.Text;
                yAxis3.Title.FontSpec       = YTitle.Clone();
                yAxis3.Scale.FontSpec       = YScale.Clone();
                yAxis3.Scale.FontSpec.Angle = 270;

                yAxis3.Scale.FontSpec.FontColor = cCur.FontColor; //刻度字体颜色
                yAxis3.Title.FontSpec.FontColor = cCur.FontColor; //标题字体颜色
                yAxis3.MajorTic.Color           = GridColor;      //主网格刻度尺颜色
                yAxis3.Color               = GridColor;
                yAxis3.MinorTic.Color      = GridColor;           //次网格刻度尺颜色
                yAxis3.MajorGrid.IsVisible = true;                //是否显示主网格刻度线
                yAxis3.MajorGrid.Color     = GridColor;           //主网格刻度线颜色
                // turn off the opposite tics so the Y2 tics don't show up on the Y axis
                yAxis3.MajorTic.IsInside   = true;                // false;
                yAxis3.MinorTic.IsInside   = false;
                yAxis3.MajorTic.IsOpposite = false;
                yAxis3.MinorTic.IsOpposite = false;
                // Align the Y2 axis labels so they are flush to the axis
                yAxis3.Scale.Align   = AlignP.Inside;
                yAxis3.IsVisible     = true;
                yAxis3.Scale.Min     = cCur.ScaleMin;
                yAxis3.Scale.MinAuto = cCur.ScaleMinAuto;
                yAxis3.Scale.Max     = cCur.ScaleMax;
                yAxis3.Scale.MaxAuto = cCur.ScaleMaxAuto;
            }
            catch (Exception)
            { }
        }
示例#3
0
 private void butOK_Click(object sender, EventArgs e)
 {
     ListCurGroup.Clear();
     for (int i = 0; i < dGV1.RowCount; i++)
     {
         if (dGV1.Rows[i].Cells[0].Value == null)
         {
             continue;
         }
         string str0 = dGV1.Rows[i].Cells[0].Value.ToString();
         if (str0.Substring(0, 1) == "第")
         {
             int           j     = Convert.ToInt32(str0.Substring(1, 1));
             CLSYAxisGroup cCurG = new CLSYAxisGroup(dGV1.Rows[i].Cells[1].Value.ToString());
             cCurG.FontColor = dGV1.Rows[i].Cells[2].Style.BackColor;
             ListCurGroup.Add(cCurG);
         }
         else
         {
             int j = Convert.ToInt32(str0);
             ListCur[j - 1].Text      = dGV1.Rows[i].Cells[1].Value.ToString();
             ListCur[j - 1].LineColor = dGV1.Rows[i].Cells[2].Style.BackColor;
             ListCurGroup[ListCurGroup.Count - 1].ListCur.Add(ListCur[j - 1]);
         }
     }
     this.DialogResult = System.Windows.Forms.DialogResult.OK;
 }
示例#4
0
 public void LoadFromXML(XmlElement Node)
 {
     try
     {
         Name = Node.GetAttribute("Name");
         foreach (XmlElement node in Node.ChildNodes)
         {
             string        str1   = node.GetAttribute("Text");
             CLSYAxisGroup nYAxis = new CLSYAxisGroup(str1);
             nYAxis.LoadFromXML(node);
             ListYAxisGroup.Add(nYAxis);
         }
     }
     catch (Exception e)
     {
     }
 }
示例#5
0
文件: CLSChart.cs 项目: tomyqg/SemiGC
        public void DrawYAxis()
        {
            myPane.CurveList.Clear();
            if (SelTream.ListYAxisGroup.Count < 1)
            {
                zedG.AxisChange();
                zedG.Refresh();
                return;
            }
            myPane.XAxis.Title.Text = XAxisTitle;
            for (int i = 0; i < SelTream.ListYAxisGroup.Count; i++)
            {
                CLSYAxisGroup cCur = SelTream.ListYAxisGroup[i];
                if (i == 0)
                {
                    // Make the Y axis scale red
                    SetYAxis(myPane.YAxis, AxisYTitle.FontSpec, AxisYScale.FontSpec, cCur);
                }
                else if (i == 1)
                {
                    SetYAxis(myPane.Y2Axis, AxisYTitle.FontSpec, AxisYScale.FontSpec, cCur);
                }
                else if (i % 2 == 0)
                {
                    YAxis yAxis3 = new YAxis(cCur.Text);
                    SetYAxis(yAxis3, AxisYTitle.FontSpec, AxisYScale.FontSpec, cCur);
                    myPane.YAxisList.Add(yAxis3);
                }
                else if (i % 2 == 1)
                {
                    Y2Axis yAxis3 = new Y2Axis(cCur.Text);
                    SetYAxis(yAxis3, AxisYTitle.FontSpec, AxisYScale.FontSpec, cCur);
                    myPane.Y2AxisList.Add(yAxis3);
                }
                else
                {
                    return;
                }

                int i1 = i % 2;
                int i2 = i / 2;

                foreach (CLSCurve nCur in cCur.ListCur)
                {
                    LineItem myCurve = myPane.AddCurve(nCur.Text, nCur.ListPT, nCur.LineColor, SymbolType.None);
                    myCurve.Symbol.Size = 10;
                    myCurve.Line.Width  = CurveLineWith;
                    //myCurve.Line.Style = DashStyle.DashDotDot;
                    // Fill the symbols with white
                    //myCurve.Symbol.Fill = new Fill(Color.White);
                    myCurve.YAxisIndex = i2;
                    if (i1 == 1)
                    {
                        // Associate this curve with the Y2 axis
                        myCurve.IsY2Axis = true;
                    }
                }
            }

            zedG.AxisChange();
            zedG.Refresh();
        }