示例#1
0
        //private void BindingDataChart()
        //{
        //    try
        //    {
        //        DataTable dt = SMT_EMD_BTS_MONTHLY_SELECT("C", "2019", "", "");
        //        ChartVSM.DataSource = dt;
        //        ChartVSM.Series[0].ArgumentDataMember = "DD";
        //        ChartVSM.Series[0].ValueDataMembers.AddRange(new string[] { "VJ1" });
        //        ChartVSM.Series[1].ArgumentDataMember = "DD";
        //        ChartVSM.Series[1].ValueDataMembers.AddRange(new string[] { "VJ2" });

        //        chartUpper.DataSource = dt;
        //        chartUpper.Series[0].ArgumentDataMember = "DD";
        //        chartUpper.Series[0].ValueDataMembers.AddRange(new string[] { "LA" });
        //        chartUpper.Series[1].ArgumentDataMember = "DD";
        //        chartUpper.Series[1].ValueDataMembers.AddRange(new string[] { "VJ3" });
        //    }
        //    catch { }
        //}

        private void BindingDataChart()
        {
            try
            {
                DataTable dt = SMT_EMD_BTS_MONTHLY_SELECT("C", "2020", ComVar.Var._strValue1, "");
                //ChartVSM.DataSource = dt;
                //ChartVSM.Series[0].ArgumentDataMember = "DD";
                //ChartVSM.Series[0].ValueDataMembers.AddRange(new string[] { "VJ1" });
                //ChartVSM.Series[1].ArgumentDataMember = "DD";
                //ChartVSM.Series[1].ValueDataMembers.AddRange(new string[] { "VJ2" });
                DevExpress.XtraCharts.ChartTitle     chartTitle1     = new DevExpress.XtraCharts.ChartTitle();
                DevExpress.XtraCharts.LineSeriesView lineSeriesView1 = new DevExpress.XtraCharts.LineSeriesView();
                ChartVSM.DataSource       = dt;
                ChartVSM.SeriesDataMember = "DIV";
                ChartVSM.SeriesTemplate.ArgumentDataMember = "YMD";
                ChartVSM.SeriesTemplate.ValueDataMembers.AddRange(new string[] { "BTS" });
                ChartVSM.SeriesTemplate.View             = lineSeriesView1;
                ChartVSM.SeriesTemplate.LabelsVisibility = DevExpress.Utils.DefaultBoolean.True;
                ChartVSM.Titles.Clear();
                chartTitle1.Font = new System.Drawing.Font("Tahoma", 14F);
                chartTitle1.Text = ComVar.Var._strValue2;// + " Support";
                this.ChartVSM.Titles.AddRange(new DevExpress.XtraCharts.ChartTitle[] {
                    chartTitle1
                });
                lineSeriesView1.MarkerVisibility = DevExpress.Utils.DefaultBoolean.True;
            }
            catch { }
        }
        protected override void UpdateChart()
        {
            var chartTitle = new DevExpress.XtraCharts.ChartTitle();

            SetupXtraChartTitle(chartTitle);
            ChartContext.Chart.Titles.Add(chartTitle);
        }
示例#3
0
 private void IterateChartControl(ChartControl chartControl)
 {
     if (chartControl == null)
     {
         return;
     }
     if (chartControl.Series != null && chartControl.Series.Count > 0)
     {
         Series item = null;
         for (int i = 0; i < chartControl.Series.Count; i++)
         {
             item = chartControl.Series[i];
             if (item == null)
             {
                 continue;
             }
             Apply(item, chartControl.Name + "Series" + (i + 1).ToString());
         }
     }
     if (chartControl.Titles != null && chartControl.Titles.Count > 0)
     {
         DevExpress.XtraCharts.ChartTitle item = null;
         for (int i = 0; i < chartControl.Titles.Count; i++)
         {
             item = chartControl.Titles[i];
             if (item == null)
             {
                 continue;
             }
             Apply(item, chartControl.Name + "Title" + (i + 1).ToString());
         }
     }
 }
示例#4
0
        private ChartControl getPieChartControl(string variableName, Dictionary <string, int> platformDict, int chartIndex)
        {
            ChartControl chartControl1 = new ChartControl();

            // normalConfigure
            chartControl1.Dock = System.Windows.Forms.DockStyle.Top;
            chartControl1.EmptyChartText.Text = "\r\n";
            chartControl1.Legend.Visible      = false;
            chartControl1.Location            = new System.Drawing.Point(0, 0);
            chartControl1.Name = "chartControl" + chartIndex;

            //configure pie series
            DevExpress.XtraCharts.Series series1 = new DevExpress.XtraCharts.Series();
            series1.Label.PointOptions.PointView = PointView.ArgumentAndValues;
            series1.Label.PointOptions.ValueNumericOptions.Format = DevExpress.XtraCharts.NumericFormat.Percent;
            series1.Label.LineVisible = true;
            series1.LabelsVisibility  = DevExpress.Utils.DefaultBoolean.True;
            series1.Name = "Series 1";

            List <SeriesPoint> seriesPointLIst = new List <SeriesPoint>();
            int pointIndex = 0;

            foreach (KeyValuePair <string, int> kv in platformDict)
            {
                DevExpress.XtraCharts.SeriesPoint seriesPoint = new DevExpress.XtraCharts.SeriesPoint(kv.Key, new object[] {
                    ((object)(kv.Value))
                }, pointIndex);
                seriesPointLIst.Add(seriesPoint);
                pointIndex++;
            }
            series1.Points.AddRange(seriesPointLIst.ToArray());
            DevExpress.XtraCharts.PieSeriesView pieSeriesView1 = new DevExpress.XtraCharts.PieSeriesView();
            pieSeriesView1.RuntimeExploding = false;
            series1.View = pieSeriesView1;

            // configure chart series array
            chartControl1.SeriesSerializable = new DevExpress.XtraCharts.Series[] {
                series1
            };

            DevExpress.XtraCharts.ChartTitle chartTitle1 = new DevExpress.XtraCharts.ChartTitle();
            chartTitle1.Text      = variableName;
            chartTitle1.TextColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
            chartControl1.Titles.AddRange(new DevExpress.XtraCharts.ChartTitle[] {
                chartTitle1
            });


            chartControl1.SeriesTemplate.Label.PointOptions.ValueNumericOptions.Format = DevExpress.XtraCharts.NumericFormat.General;
            chartControl1.SeriesTemplate.Label.LineVisible = true;

            //configure chart seriesTemplate View
            DevExpress.XtraCharts.PieSeriesView pieSeriesView2 = new DevExpress.XtraCharts.PieSeriesView();
            pieSeriesView2.RuntimeExploding   = false;
            chartControl1.SeriesTemplate.View = pieSeriesView2;
            chartControl1.Size     = new System.Drawing.Size(500, 500);
            chartControl1.TabIndex = chartIndex;

            return(chartControl1);
        }
        public void SetupXtraChartTitle(DevExpress.XtraCharts.ChartTitle title)
        {
            title.Alignment          = Alignment;
            title.EnableAntialiasing = DefaultBoolean.True;
            title.Text       = Text;
            title.Visibility = DefaultBoolean.True;
            title.WordWrap   = WordWrap;

            if (Dock.HasValue)
            {
                title.Dock = Dock.Value;
            }
            if (Indent.HasValue)
            {
                title.Indent = Indent.Value;
            }

            var font = Utils.StringToFont(Font, out Color fontColor);

            if (font != null)
            {
                title.Font = font;
            }
            if (fontColor != Color.Empty)
            {
                title.TextColor = fontColor;
            }
        }
示例#6
0
 private void CreatTitleName()
 {
     DevExpress.XtraCharts.ChartTitle chartTitle = new DevExpress.XtraCharts.ChartTitle();
     chartTitle.Text      = "Pareto Chart of 来料不良类别"; //标题内容
     chartTitle.TextColor = Color.Black;              //颜色设置
     chartTitle.Font      = new Font("Tahoma", 13);   //字体类型字号
     chartTitle.Alignment = StringAlignment.Center;
     chartControl1.Titles.Clear();
     chartControl1.Titles.Add(chartTitle);
 }
示例#7
0
        private void InitChart(string sChart, DataTable dt, DevExpress.XtraCharts.ChartControl chartControl)
        {
            try
            {
                var sTitle     = new List <string>();
                int mLineStart = Convert.ToInt32(line.Equals("099") ? mline : line);
                if (mLineStart == 3)
                {
                    mLineStart = 2;
                }
                else if (mLineStart == 2)
                {
                    mLineStart = 3;
                }
                if (!sChart.Equals("UPC"))
                {
                    switch (line)
                    {
                    case "001":
                    case "002":
                    case "003":
                    case "004":
                    case "005":
                    case "006":
                        for (int i = 1; i <= 3; i++)
                        {
                            sTitle.Add("Stitching " + ((mLineStart - 1) * 3 + i).ToString());
                        }
                        break;

                    default:
                        for (int i = 1; i <= 2; i++)
                        {
                            sTitle.Add("Stitching " + ((mLineStart - 1) * 2 + i).ToString());
                        }
                        break;
                    }
                }
                DevExpress.XtraCharts.ChartTitle chartTitle = new DevExpress.XtraCharts.ChartTitle();
                chartControl.DataSource = dt.Select("HMS <>'TOTAL'").CopyToDataTable();
                chartControl.Series[0].ArgumentDataMember = "HMS";
                chartControl.Series[0].ValueDataMembers.AddRange(new string[] { sChart + "_RATE1" });
                ((DevExpress.XtraCharts.XYDiagram)chartControl.Diagram).AxisX.QualitativeScaleOptions.AutoGrid = false;
                if (!sChart.Equals("UPC"))
                {
                    chartTitle.Text = sTitle[Convert.ToInt32(sChart.Substring(3, 1)) - 1];
                    chartControl.Titles.Clear();
                    chartControl.Titles.AddRange(new DevExpress.XtraCharts.ChartTitle[] { chartTitle });
                }
            }
            catch { }
            finally {
                BindingGauge(dt);
            }
        }
示例#8
0
        private void CreatTitleName()
        {
            string title1    = "";
            string title2    = "";
            string title3    = "";
            string title4    = "";
            string TitleName = "";

            if (comboBox1.SelectedItem == null)
            {
                MessageBox.Show("请输入业务类型");
                Judge = false;
                return;
            }
            if (comboBox2.SelectedItem == null)
            {
                MessageBox.Show("请选择客户");
                Judge = false;
                return;
            }
            if (comboBox2.SelectedIndex != 34)
            {
                if (comboBox3.SelectedItem == null)
                {
                    MessageBox.Show("请选择报表类型");
                    Judge = false;
                    return;
                }
                if (comboBox1.SelectedIndex == 0)
                {
                    title1 = "EMS ";
                }
                if (comboBox2.SelectedIndex != 34)
                {
                    title2    = comboBox2.SelectedItem.ToString();
                    title3    = "客户" + "出货检验";
                    title4    = comboBox3.SelectedItem.ToString();
                    TitleName = title1 + title2 + title3 + title4;
                    gridView1.OptionsView.ShowGroupPanel = true;
                    gridView1.GroupPanelText             = TitleName.ToString();
                }
            }

            //  chartControl1.Series.Clear();
            DevExpress.XtraCharts.ChartTitle chartTitle = new DevExpress.XtraCharts.ChartTitle();
            chartTitle.Text      = TitleName;              //标题内容
            chartTitle.TextColor = Color.Black;            //颜色设置
            chartTitle.Font      = new Font("Tahoma", 12); //字体类型字号
            chartTitle.Alignment = StringAlignment.Center;
            chartControl1.Titles.Clear();
            chartControl1.Titles.Add(chartTitle);
        }
        private void InitChart(string sChart, DataTable dt, DevExpress.XtraCharts.ChartControl chartControl)
        {
            try
            {
                var sTitle = new List <string>();
                //int mLineStart = Convert.ToInt32(line.Equals("202") ? mline : line);
                //if (mLineStart == 3)
                //    mLineStart = 2;
                //else if (mLineStart == 2)
                //    mLineStart = 3;
                //if (!sChart.Equals("UPC"))
                //{
                //    switch (line)
                //    {

                //        case "001":
                //        case "002":
                //        case "003":
                //        case "004":
                //        case "005":
                //        case "006":
                //            for (int i = 1; i <= 3; i++)
                //                sTitle.Add("Stitching " + ((mLineStart - 1) * 3 + i).ToString());
                //            break;
                //        default:
                //            for (int i = 1; i <= 2; i++)
                //                sTitle.Add("Stitching " + ((mLineStart - 1) * 2 + i).ToString());
                //            break;
                //    }
                //}
                DevExpress.XtraCharts.ChartTitle chartTitle = new DevExpress.XtraCharts.ChartTitle();
                chartControl.DataSource = dt.Select("DAY <> 'AVG'", "DAY").CopyToDataTable();
                chartControl.Series[1].ArgumentDataMember = "DAY";
                chartControl.Series[1].ValueDataMembers.AddRange(new string[] { sChart + "_TAR" });
                chartControl.Series[0].ArgumentDataMember = "DAY";
                chartControl.Series[0].ValueDataMembers.AddRange(new string[] { sChart + "_ACT" });
                ((DevExpress.XtraCharts.XYDiagram)chartControl.Diagram).AxisX.QualitativeScaleOptions.AutoGrid = false;
                if (!sChart.Equals("UPC"))
                {
                    chartTitle.Text = sTitle[Convert.ToInt32(sChart.Substring(3, 1)) - 1];
                    chartControl.Titles.Clear();
                    chartControl.Titles.AddRange(new DevExpress.XtraCharts.ChartTitle[] { chartTitle });
                }
            }
            catch { }
            finally { BindingGauge(dt); }
        }
 private void InitChart(string sChart, DataTable dt, DevExpress.XtraCharts.ChartControl chartControl)
 {
     try
     {
         var sTitle = new List <string>();
         DevExpress.XtraCharts.ChartTitle chartTitle = new DevExpress.XtraCharts.ChartTitle();
         chartControl.DataSource = dt.Select("HMS <>'TOTAL'").CopyToDataTable();
         chartControl.Series[1].ArgumentDataMember = "HMS";
         chartControl.Series[1].ValueDataMembers.AddRange(new string[] { sChart + "_TAR" });
         chartControl.Series[0].ArgumentDataMember = "HMS";
         chartControl.Series[0].ValueDataMembers.AddRange(new string[] { sChart + "_ACT" });
         chartTitle.Text = sTitle[Convert.ToInt32(sChart.Substring(3, 1)) - 1];
         chartControl.Titles.Clear();
         chartControl.Titles.AddRange(new DevExpress.XtraCharts.ChartTitle[] { chartTitle });
         ((DevExpress.XtraCharts.XYDiagram)chartControl.Diagram).AxisX.QualitativeScaleOptions.AutoGrid = false;
     }
     catch { }
 }
示例#11
0
        public void BindingChart(DataTable dt, string TITLE)
        {
            try
            {
                DevExpress.XtraCharts.ChartTitle chartTitle1 = new DevExpress.XtraCharts.ChartTitle();
                chartControl1.DataSource = dt;
                if (!TITLE.ToUpper().Contains("RATIO"))
                {
                    chartControl1.Series[0].Name = "PO";
                    chartControl1.Series[0].ArgumentDataMember = "DIV";
                    chartControl1.Series[0].ValueDataMembers.AddRange(new string[] { "TO_QTY" });
                    chartControl1.Series[1].Name = "TO";
                    chartControl1.Series[1].ArgumentDataMember = "DIV";
                    chartControl1.Series[1].ValueDataMembers.AddRange(new string[] { "PO_QTY" });

                    if (TITLE.ToUpper().Equals("TOTAL"))
                    {
                        chartControl1.BackColor = System.Drawing.Color.FromArgb(253, 234, 218);
                        ((DevExpress.XtraCharts.XYDiagram)chartControl1.Diagram).DefaultPane.BackColor = System.Drawing.Color.FromArgb(253, 234, 218);
                    }
                    else
                    {
                        chartControl1.BackColor = Color.White;
                        ((DevExpress.XtraCharts.XYDiagram)chartControl1.Diagram).DefaultPane.BackColor = Color.White;
                    }
                }
                else
                {
                    chartControl1.CustomDrawSeriesPoint       += new DevExpress.XtraCharts.CustomDrawSeriesPointEventHandler(this.chartControl1_CustomDrawSeriesPoint);
                    chartControl1.Series[0].Name               = "RATIO";
                    chartControl1.Series[0].View.Color         = Color.Green;
                    chartControl1.Series[1].ShowInLegend       = false;
                    chartControl1.Series[0].ArgumentDataMember = "DIV";
                    chartControl1.Series[0].ValueDataMembers.AddRange(new string[] { "RATE" });
                    chartControl1.BackColor = System.Drawing.Color.FromArgb(253, 234, 218);
                    ((DevExpress.XtraCharts.XYDiagram)chartControl1.Diagram).DefaultPane.BackColor = System.Drawing.Color.FromArgb(253, 234, 218);
                }
                chartControl1.Titles.Clear();
                chartTitle1.Text = TITLE;

                this.chartControl1.Titles.AddRange(new DevExpress.XtraCharts.ChartTitle[] { chartTitle1 });
            }
            catch (Exception ex) { }
        }
示例#12
0
 private void InitializeComponent()
 {
     DevExpress.XtraCharts.ChartTitle chartTitle1 = new DevExpress.XtraCharts.ChartTitle();
     this.layoutControl1      = new DevExpress.XtraLayout.LayoutControl();
     this.xtrTC               = new DevExpress.XtraTab.XtraTabControl();
     this.xtraTabPage1        = new DevExpress.XtraTab.XtraTabPage();
     this.layoutControl2      = new DevExpress.XtraLayout.LayoutControl();
     this.btnStatsOutput      = new DevExpress.XtraEditors.SimpleButton();
     this.chartControl1       = new DevExpress.XtraCharts.ChartControl();
     this.comboBoxEdit1       = new DevExpress.XtraEditors.ComboBoxEdit();
     this.layoutControlGroup2 = new DevExpress.XtraLayout.LayoutControlGroup();
     this.layoutControlItem2  = new DevExpress.XtraLayout.LayoutControlItem();
     this.layoutControlItem3  = new DevExpress.XtraLayout.LayoutControlItem();
     this.emptySpaceItem1     = new DevExpress.XtraLayout.EmptySpaceItem();
     this.emptySpaceItem2     = new DevExpress.XtraLayout.EmptySpaceItem();
     this.layoutControlItem4  = new DevExpress.XtraLayout.LayoutControlItem();
     this.layoutControlGroup1 = new DevExpress.XtraLayout.LayoutControlGroup();
     this.layoutControlItem1  = new DevExpress.XtraLayout.LayoutControlItem();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
     this.layoutControl1.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.xtrTC)).BeginInit();
     this.xtrTC.SuspendLayout();
     this.xtraTabPage1.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControl2)).BeginInit();
     this.layoutControl2.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.chartControl1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.comboBoxEdit1.Properties)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup2)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem2)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).BeginInit();
     this.SuspendLayout();
     //
     // layoutControl1
     //
     this.layoutControl1.Controls.Add(this.xtrTC);
     this.layoutControl1.Dock     = System.Windows.Forms.DockStyle.Fill;
     this.layoutControl1.Location = new System.Drawing.Point(0, 0);
     this.layoutControl1.Name     = "layoutControl1";
     this.layoutControl1.OptionsCustomizationForm.DesignTimeCustomizationFormPositionAndSize = new System.Drawing.Rectangle(895, 161, 250, 350);
     this.layoutControl1.Root     = this.layoutControlGroup1;
     this.layoutControl1.Size     = new System.Drawing.Size(575, 413);
     this.layoutControl1.TabIndex = 0;
     this.layoutControl1.Text     = "layoutControl1";
     //
     // xtrTC
     //
     this.xtrTC.Location        = new System.Drawing.Point(2, 2);
     this.xtrTC.Name            = "xtrTC";
     this.xtrTC.SelectedTabPage = this.xtraTabPage1;
     this.xtrTC.Size            = new System.Drawing.Size(571, 409);
     this.xtrTC.TabIndex        = 4;
     this.xtrTC.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[] {
         this.xtraTabPage1
     });
     //
     // xtraTabPage1
     //
     this.xtraTabPage1.Controls.Add(this.layoutControl2);
     this.xtraTabPage1.Name = "xtraTabPage1";
     this.xtraTabPage1.Size = new System.Drawing.Size(565, 380);
     this.xtraTabPage1.Text = "统计图";
     //
     // layoutControl2
     //
     this.layoutControl2.Controls.Add(this.btnStatsOutput);
     this.layoutControl2.Controls.Add(this.chartControl1);
     this.layoutControl2.Controls.Add(this.comboBoxEdit1);
     this.layoutControl2.Dock     = System.Windows.Forms.DockStyle.Fill;
     this.layoutControl2.Location = new System.Drawing.Point(0, 0);
     this.layoutControl2.Name     = "layoutControl2";
     this.layoutControl2.Root     = this.layoutControlGroup2;
     this.layoutControl2.Size     = new System.Drawing.Size(565, 380);
     this.layoutControl2.TabIndex = 0;
     this.layoutControl2.Text     = "layoutControl2";
     //
     // btnStatsOutput
     //
     this.btnStatsOutput.Location        = new System.Drawing.Point(452, 356);
     this.btnStatsOutput.Name            = "btnStatsOutput";
     this.btnStatsOutput.Size            = new System.Drawing.Size(111, 22);
     this.btnStatsOutput.StyleController = this.layoutControl2;
     this.btnStatsOutput.TabIndex        = 6;
     this.btnStatsOutput.Text            = "输出统计";
     this.btnStatsOutput.Click          += new System.EventHandler(this.btnStatsOutput_Click);
     //
     // chartControl1
     //
     this.chartControl1.Location           = new System.Drawing.Point(2, 28);
     this.chartControl1.Name               = "chartControl1";
     this.chartControl1.SeriesSerializable = new DevExpress.XtraCharts.Series[0];
     this.chartControl1.Size               = new System.Drawing.Size(561, 324);
     this.chartControl1.TabIndex           = 5;
     this.chartControl1.Titles.AddRange(new DevExpress.XtraCharts.ChartTitle[] {
         chartTitle1
     });
     //
     // comboBoxEdit1
     //
     this.comboBoxEdit1.Location = new System.Drawing.Point(440, 2);
     this.comboBoxEdit1.Name     = "comboBoxEdit1";
     this.comboBoxEdit1.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
         new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)
     });
     this.comboBoxEdit1.Size                  = new System.Drawing.Size(123, 22);
     this.comboBoxEdit1.StyleController       = this.layoutControl2;
     this.comboBoxEdit1.TabIndex              = 4;
     this.comboBoxEdit1.SelectedIndexChanged += new System.EventHandler(this.comboBoxEdit1_SelectedIndexChanged);
     //
     // layoutControlGroup2
     //
     this.layoutControlGroup2.CustomizationFormText       = "layoutControlGroup2";
     this.layoutControlGroup2.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True;
     this.layoutControlGroup2.GroupBordersVisible         = false;
     this.layoutControlGroup2.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
         this.layoutControlItem2,
         this.layoutControlItem3,
         this.emptySpaceItem1,
         this.emptySpaceItem2,
         this.layoutControlItem4
     });
     this.layoutControlGroup2.Location    = new System.Drawing.Point(0, 0);
     this.layoutControlGroup2.Name        = "layoutControlGroup2";
     this.layoutControlGroup2.Padding     = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0);
     this.layoutControlGroup2.Size        = new System.Drawing.Size(565, 380);
     this.layoutControlGroup2.Text        = "layoutControlGroup2";
     this.layoutControlGroup2.TextVisible = false;
     //
     // layoutControlItem2
     //
     this.layoutControlItem2.Control = this.comboBoxEdit1;
     this.layoutControlItem2.CustomizationFormText = "统计图样式:";
     this.layoutControlItem2.Location = new System.Drawing.Point(363, 0);
     this.layoutControlItem2.Name     = "layoutControlItem2";
     this.layoutControlItem2.Size     = new System.Drawing.Size(202, 26);
     this.layoutControlItem2.Text     = "统计图样式:";
     this.layoutControlItem2.TextSize = new System.Drawing.Size(72, 14);
     //
     // layoutControlItem3
     //
     this.layoutControlItem3.Control = this.chartControl1;
     this.layoutControlItem3.CustomizationFormText = "layoutControlItem3";
     this.layoutControlItem3.Location = new System.Drawing.Point(0, 26);
     this.layoutControlItem3.Name     = "layoutControlItem3";
     this.layoutControlItem3.Size     = new System.Drawing.Size(565, 328);
     this.layoutControlItem3.Text     = "layoutControlItem3";
     this.layoutControlItem3.TextSize = new System.Drawing.Size(0, 0);
     this.layoutControlItem3.TextToControlDistance = 0;
     this.layoutControlItem3.TextVisible           = false;
     //
     // emptySpaceItem1
     //
     this.emptySpaceItem1.AllowHotTrack         = false;
     this.emptySpaceItem1.CustomizationFormText = "emptySpaceItem1";
     this.emptySpaceItem1.Location = new System.Drawing.Point(0, 0);
     this.emptySpaceItem1.Name     = "emptySpaceItem1";
     this.emptySpaceItem1.Size     = new System.Drawing.Size(363, 26);
     this.emptySpaceItem1.Text     = "emptySpaceItem1";
     this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0);
     //
     // emptySpaceItem2
     //
     this.emptySpaceItem2.AllowHotTrack         = false;
     this.emptySpaceItem2.CustomizationFormText = "emptySpaceItem2";
     this.emptySpaceItem2.Location = new System.Drawing.Point(0, 354);
     this.emptySpaceItem2.Name     = "emptySpaceItem2";
     this.emptySpaceItem2.Size     = new System.Drawing.Size(450, 26);
     this.emptySpaceItem2.Text     = "emptySpaceItem2";
     this.emptySpaceItem2.TextSize = new System.Drawing.Size(0, 0);
     //
     // layoutControlItem4
     //
     this.layoutControlItem4.Control = this.btnStatsOutput;
     this.layoutControlItem4.CustomizationFormText = "layoutControlItem4";
     this.layoutControlItem4.Location = new System.Drawing.Point(450, 354);
     this.layoutControlItem4.Name     = "layoutControlItem4";
     this.layoutControlItem4.Size     = new System.Drawing.Size(115, 26);
     this.layoutControlItem4.Text     = "layoutControlItem4";
     this.layoutControlItem4.TextSize = new System.Drawing.Size(0, 0);
     this.layoutControlItem4.TextToControlDistance = 0;
     this.layoutControlItem4.TextVisible           = false;
     //
     // layoutControlGroup1
     //
     this.layoutControlGroup1.CustomizationFormText       = "Root";
     this.layoutControlGroup1.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True;
     this.layoutControlGroup1.GroupBordersVisible         = false;
     this.layoutControlGroup1.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
         this.layoutControlItem1
     });
     this.layoutControlGroup1.Location    = new System.Drawing.Point(0, 0);
     this.layoutControlGroup1.Name        = "Root";
     this.layoutControlGroup1.Padding     = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0);
     this.layoutControlGroup1.Size        = new System.Drawing.Size(575, 413);
     this.layoutControlGroup1.Text        = "Root";
     this.layoutControlGroup1.TextVisible = false;
     //
     // layoutControlItem1
     //
     this.layoutControlItem1.Control = this.xtrTC;
     this.layoutControlItem1.CustomizationFormText = "layoutControlItem1";
     this.layoutControlItem1.Location = new System.Drawing.Point(0, 0);
     this.layoutControlItem1.Name     = "layoutControlItem1";
     this.layoutControlItem1.Size     = new System.Drawing.Size(575, 413);
     this.layoutControlItem1.Text     = "layoutControlItem1";
     this.layoutControlItem1.TextSize = new System.Drawing.Size(0, 0);
     this.layoutControlItem1.TextToControlDistance = 0;
     this.layoutControlItem1.TextVisible           = false;
     //
     // FrmPipeStatsChart2D
     //
     this.ClientSize = new System.Drawing.Size(575, 413);
     this.Controls.Add(this.layoutControl1);
     this.Name          = "FrmPipeStatsChart2D";
     this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
     this.Text          = "管线长度统计图表";
     this.Load         += new System.EventHandler(this.FrmPipeLineLengthStatsChart2D_Load);
     ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).EndInit();
     this.layoutControl1.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(this.xtrTC)).EndInit();
     this.xtrTC.ResumeLayout(false);
     this.xtraTabPage1.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(this.layoutControl2)).EndInit();
     this.layoutControl2.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(this.chartControl1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.comboBoxEdit1.Properties)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup2)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem2)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).EndInit();
     this.ResumeLayout(false);
 }
示例#13
0
        private void Graph_Init_for_Sensitivity(Sensitvity_Measurement mySen)
        {
            //Zwischenspeicher umschreiben
            akt_Graph_Setup = "Sensitivity";

            //Größe der Überschriften
            Font myFont_Headline = new Font("Tahoma", 12, FontStyle.Bold);
            Font myFont_Axis     = new Font("Tahoma", 10);

            DevExpress.XtraCharts.ChartTitle myChartTitle;

            //Ober Graph für RAW............................................................................
            chartControl_RAW.Series.Clear();

            myChartTitle = new DevExpress.XtraCharts.ChartTitle()
            {
                Text = "Raw Values DAC",
                Font = myFont_Headline,
                Dock = DevExpress.XtraCharts.ChartTitleDockStyle.Top,
            };

            chartControl_RAW.Titles.Clear();
            chartControl_RAW.Titles.Add(myChartTitle);

            //Diagramm erzeugen (Muss wegen laufzeit in Begin Init und EndInit)
            XYDiagram xyDigaram_RAW;

            ((System.ComponentModel.ISupportInitialize)(this.chartControl_RAW)).BeginInit();
            xyDigaram_RAW            = new XYDiagram();
            chartControl_RAW.Diagram = xyDigaram_RAW;


            //Achsen-Titel setzen
            xyDigaram_RAW.AxisX.Title.Text       = "Time in [s]";
            xyDigaram_RAW.AxisX.Title.Visibility = DevExpress.Utils.DefaultBoolean.True;
            xyDigaram_RAW.AxisX.Title.Font       = myFont_Axis;
            xyDigaram_RAW.AxisY.Title.Text       = "Bit-Value";
            xyDigaram_RAW.AxisY.Title.Visibility = DevExpress.Utils.DefaultBoolean.True;
            xyDigaram_RAW.AxisY.Title.Font       = myFont_Axis;

            //Min-Max - Achse
            double zeit_max = (double)mySen.Nr_of_samples / mySen.MySpectrum.Frequency;

            xyDigaram_RAW.AxisX.VisibleInPanesSerializable      = "-1";
            xyDigaram_RAW.AxisX.VisualRange.Auto                = false;
            xyDigaram_RAW.AxisX.WholeRange.MaxValue             = zeit_max; //Zugelassener Bereich
            xyDigaram_RAW.AxisX.WholeRange.MinValue             = 0;
            xyDigaram_RAW.AxisX.VisualRange.MaxValue            = zeit_max; //Sichtbarrer Bereich
            xyDigaram_RAW.AxisX.VisualRange.MinValue            = 0;
            xyDigaram_RAW.AxisX.VisualRange.SideMarginsValue    = 0;        //Überstand Links und rechts
            xyDigaram_RAW.AxisX.NumericScaleOptions.AutoGrid    = false;
            xyDigaram_RAW.AxisX.NumericScaleOptions.GridSpacing = zeit_max / 4;



            xyDigaram_RAW.AxisY.VisibleInPanesSerializable      = "-1";
            xyDigaram_RAW.AxisY.VisualRange.Auto                = false;
            xyDigaram_RAW.AxisY.WholeRange.MaxValue             = 32768;
            xyDigaram_RAW.AxisY.WholeRange.MinValue             = -32768;
            xyDigaram_RAW.AxisY.VisualRange.MaxValue            = 32768; //Sichtbarrer Bereich
            xyDigaram_RAW.AxisY.VisualRange.MinValue            = -32768;
            xyDigaram_RAW.AxisY.NumericScaleOptions.AutoGrid    = false;
            xyDigaram_RAW.AxisY.NumericScaleOptions.GridSpacing = 16384;
            xyDigaram_RAW.AxisY.Interlaced = true;
            xyDigaram_RAW.AxisY.VisualRange.SideMarginsValue = 1;     //Überstand Links und rechts

            ((System.ComponentModel.ISupportInitialize)(this.chartControl_RAW)).EndInit();

            //Label & Legend
            chartControl_RAW.CrosshairOptions.GroupHeaderPattern = "{A} sec";
            chartControl_RAW.CrosshairOptions.HighlightPoints    = false;

            chartControl_RAW.Legend.MarkerMode = LegendMarkerMode.CheckBox;

            //Hinzufügen leere unsichbare Serie (damit Achsen angezeigt werden)
            var neueSerie = new Series("Empty", ViewType.Line)
            {
                LabelsVisibility = DevExpress.Utils.DefaultBoolean.False,
                ShowInLegend     = false,
                Visible          = true,
            };

            chartControl_RAW.Series.Add(neueSerie);


            //Ober Graph für RAW................................................................................
            chartControl_DATA_Top.Series.Clear();

            myChartTitle = new DevExpress.XtraCharts.ChartTitle()
            {
                Text = "Voltage @ Temperature",
                Font = myFont_Headline,
                Dock = DevExpress.XtraCharts.ChartTitleDockStyle.Top
            };

            chartControl_DATA_Top.Titles.Clear();
            chartControl_DATA_Top.Titles.Add(myChartTitle);

            //Diagramm erzeugen (Muss wegen laufzeit in Begin Init und EndInit)
            XYDiagram xyDiagram_DATA_Top;

            ((System.ComponentModel.ISupportInitialize)(this.chartControl_DATA_Top)).BeginInit();
            xyDiagram_DATA_Top            = new XYDiagram();
            chartControl_DATA_Top.Diagram = xyDiagram_DATA_Top;


            //Achsen-Titel setzen
            xyDiagram_DATA_Top.AxisX.Title.Text       = "Temperature [°C]";
            xyDiagram_DATA_Top.AxisX.Title.Visibility = DevExpress.Utils.DefaultBoolean.True;
            xyDiagram_DATA_Top.AxisX.Title.Font       = myFont_Axis;
            xyDiagram_DATA_Top.AxisY.Title.Text       = "Voltage [V]";
            xyDiagram_DATA_Top.AxisY.Title.Visibility = DevExpress.Utils.DefaultBoolean.True;
            xyDiagram_DATA_Top.AxisY.Title.Font       = myFont_Axis;

            //Min-Max - Achse
            xyDiagram_DATA_Top.AxisX.VisibleInPanesSerializable      = "-1";
            xyDiagram_DATA_Top.AxisX.VisualRange.Auto                = false;
            xyDiagram_DATA_Top.AxisX.WholeRange.MaxValue             = (double)mySen.TempSteps[mySen.TempSteps.Count - 1]; //Zugelassener Bereich
            xyDiagram_DATA_Top.AxisX.WholeRange.MinValue             = (double)mySen.TempSteps[0];
            xyDiagram_DATA_Top.AxisX.VisualRange.MaxValue            = (double)mySen.TempSteps[mySen.TempSteps.Count - 1]; //Sichtbarrer Bereich
            xyDiagram_DATA_Top.AxisX.VisualRange.MinValue            = (double)mySen.TempSteps[0];
            xyDiagram_DATA_Top.AxisX.NumericScaleOptions.AutoGrid    = false;
            xyDiagram_DATA_Top.AxisX.NumericScaleOptions.GridSpacing = (double)Math.Abs(mySen.TempSteps[0] - mySen.TempSteps[1]); //Abstand
            xyDiagram_DATA_Top.AxisX.NumericScaleOptions.GridOffset  = 5;                                                         //Offset wegen Margin
            xyDiagram_DATA_Top.AxisX.VisualRange.SideMarginsValue    = 5;                                                         //Überstand Links und rechts
            xyDiagram_DATA_Top.AxisX.Logarithmic = false;


            xyDiagram_DATA_Top.AxisY.VisibleInPanesSerializable      = "-1";
            xyDiagram_DATA_Top.AxisY.VisualRange.Auto                = true;
            xyDiagram_DATA_Top.AxisY.WholeRange.MaxValue             = 10;
            xyDiagram_DATA_Top.AxisY.WholeRange.MinValue             = 0;
            xyDiagram_DATA_Top.AxisY.VisualRange.MaxValue            = 10; //Sichtbarrer Bereich
            xyDiagram_DATA_Top.AxisY.VisualRange.MinValue            = 0;
            xyDiagram_DATA_Top.AxisY.NumericScaleOptions.GridSpacing = 2;
            xyDiagram_DATA_Top.AxisY.VisualRange.SideMarginsValue    = 0;  //Überstand Links und rechts

            ((System.ComponentModel.ISupportInitialize)(this.chartControl_DATA_Top)).EndInit();

            //Label & Legend
            chartControl_DATA_Top.CrosshairOptions.GroupHeaderPattern = "{A} °C";
            chartControl_DATA_Top.CrosshairOptions.HighlightPoints    = false;

            chartControl_DATA_Top.Legend.MarkerMode = LegendMarkerMode.CheckBox;

            //Hinzufügen leere unsichbare Serie (damit Achsen angezeigt werden)
            neueSerie = new Series("Empty", ViewType.Line)
            {
                LabelsVisibility = DevExpress.Utils.DefaultBoolean.False,
                ShowInLegend     = false,
                Visible          = true,
            };
            chartControl_DATA_Top.Series.Add(neueSerie);


            //Ober Graph für RAW...................................................................................
            chartControl_DATA_Bottom.Series.Clear();

            myChartTitle = new DevExpress.XtraCharts.ChartTitle()
            {
                Text = "Temperature progress",
                Font = myFont_Headline,
                Dock = DevExpress.XtraCharts.ChartTitleDockStyle.Top
            };

            chartControl_DATA_Bottom.Titles.Clear();
            chartControl_DATA_Bottom.Titles.Add(myChartTitle);

            //Diagramm erzeugen (Muss wegen laufzeit in Begin Init und EndInit)
            XYDiagram xyDiagram_DATA_Bottom;

            ((System.ComponentModel.ISupportInitialize)(this.chartControl_DATA_Bottom)).BeginInit();
            xyDiagram_DATA_Bottom            = new XYDiagram();
            chartControl_DATA_Bottom.Diagram = xyDiagram_DATA_Bottom;
            ((System.ComponentModel.ISupportInitialize)(this.chartControl_DATA_Bottom)).EndInit();

            //Achsen-Titel setzen
            xyDiagram_DATA_Bottom.AxisX.Title.Text       = "Time in [min]";
            xyDiagram_DATA_Bottom.AxisX.Title.Visibility = DevExpress.Utils.DefaultBoolean.True;
            xyDiagram_DATA_Bottom.AxisX.Title.Font       = myFont_Axis;
            xyDiagram_DATA_Bottom.AxisY.Title.Text       = "Temperature [°C]";
            xyDiagram_DATA_Bottom.AxisY.Title.Visibility = DevExpress.Utils.DefaultBoolean.True;
            xyDiagram_DATA_Bottom.AxisY.Title.Font       = myFont_Axis;

            //Min-Max - Achse
            xyDiagram_DATA_Bottom.AxisX.VisibleInPanesSerializable   = "-1";
            xyDiagram_DATA_Bottom.AxisX.VisualRange.Auto             = false;
            xyDiagram_DATA_Bottom.AxisX.WholeRange.MaxValue          = 60;    //Zugelassener Bereich
            xyDiagram_DATA_Bottom.AxisX.WholeRange.MinValue          = 0;
            xyDiagram_DATA_Bottom.AxisX.VisualRange.MaxValue         = 60;    //Sichtbarrer Bereich
            xyDiagram_DATA_Bottom.AxisX.VisualRange.MinValue         = 0;
            xyDiagram_DATA_Bottom.AxisX.VisualRange.SideMarginsValue = 0;     //Überstand Links und rechts
            xyDiagram_DATA_Bottom.AxisX.Logarithmic = false;


            xyDiagram_DATA_Bottom.AxisY.VisibleInPanesSerializable      = "-1";
            xyDiagram_DATA_Bottom.AxisY.VisualRange.Auto                = true;
            xyDiagram_DATA_Bottom.AxisY.WholeRange.MaxValue             = 85;
            xyDiagram_DATA_Bottom.AxisY.WholeRange.MinValue             = 15;
            xyDiagram_DATA_Bottom.AxisY.VisualRange.MaxValue            = (double)mySen.TempSteps[mySen.TempSteps.Count - 1]; //Sichtbarrer Bereich
            xyDiagram_DATA_Bottom.AxisY.VisualRange.MinValue            = (double)mySen.TempSteps[0];
            xyDiagram_DATA_Bottom.AxisY.NumericScaleOptions.GridSpacing = 5;
            xyDiagram_DATA_Bottom.AxisY.VisualRange.SideMarginsValue    = 5;  //Überstand Links und rechts



            //Label & Legend
            chartControl_DATA_Bottom.CrosshairOptions.GroupHeaderPattern = "{A} sec";
            chartControl_DATA_Bottom.CrosshairOptions.HighlightPoints    = false;

            chartControl_DATA_Bottom.Legend.MarkerMode = LegendMarkerMode.CheckBox;

            //Hinzufügen leere unsichbare Serie (damit Achsen angezeigt werden)
            neueSerie = new Series("Empty", ViewType.Line)
            {
                LabelsVisibility = DevExpress.Utils.DefaultBoolean.False,
                ShowInLegend     = false,
                Visible          = true,
            };
            chartControl_DATA_Bottom.Series.Add(neueSerie);

            chartControl_DATA_Bottom.Update();
        }
示例#14
0
        private void CreateChartBar(ChartControl arg_chart, DataTable arg_dt, string arg_name)
        {
            // Create a new chart.
            arg_chart.Series.Clear();
            arg_chart.Titles.Clear();
            //  ((XYDiagram)arg_chart.Diagram).AxisX.CustomLabels.Clear();
            //DataSource
            string Now = DateTime.Now.ToString("yyyyMMdd");


            // Create two series.
            //Series series1 = new Series("Production Qty", ViewType.Bar);
            Series series2 = new Series("POD", ViewType.Bar);

            // DevExpress.XtraCharts.SplineSeriesView splineSeriesView1 = new DevExpress.XtraCharts.SplineSeriesView();
            DevExpress.XtraCharts.SideBySideBarSeriesView sideBySideBarSeriesView1 = new DevExpress.XtraCharts.SideBySideBarSeriesView();
            DevExpress.XtraCharts.PointSeriesLabel        pointSeriesLabel1        = new DevExpress.XtraCharts.PointSeriesLabel();
            //DevExpress.XtraCharts.BarWidenAnimation barWidenAnimation1 = new DevExpress.XtraCharts.BarWidenAnimation();
            //DevExpress.XtraCharts.ElasticEasingFunction elasticEasingFunction1 = new DevExpress.XtraCharts.ElasticEasingFunction();


            // DevExpress.XtraCharts.XYSeriesBlowUpAnimation xySeriesBlowUpAnimation1 = new DevExpress.XtraCharts.XYSeriesBlowUpAnimation();
            DevExpress.XtraCharts.XYSeriesUnwindAnimation xySeriesUnwindAnimation1 = new DevExpress.XtraCharts.XYSeriesUnwindAnimation();
            // DevExpress.XtraCharts.XYSeriesUnwrapAnimation xySeriesUnwrapAnimation1 = new DevExpress.XtraCharts.XYSeriesUnwrapAnimation();

            DevExpress.XtraCharts.PowerEasingFunction powerEasingFunction1 = new DevExpress.XtraCharts.PowerEasingFunction();
            DevExpress.XtraCharts.SineEasingFunction  sineEasingFunction1  = new DevExpress.XtraCharts.SineEasingFunction();

            DevExpress.XtraCharts.ConstantLine constantLine1 = new DevExpress.XtraCharts.ConstantLine();

            // Add points to them, with their arguments different.

            for (int i = 0; i < arg_dt.Rows.Count; i++)
            {
                //series1.Points.Add(new SeriesPoint(dt.Rows[i]["HMS"].ToString(), dt.Rows[i]["QTY"])); //GetRandomNumber(10, 50)
                series2.Points.Add(new SeriesPoint(arg_dt.Rows[i]["LB"].ToString().Replace("_", "\n"),
                                                   arg_dt.Rows[i]["POD"] == null || arg_dt.Rows[i]["POD"].ToString() == "" ? 0 : arg_dt.Rows[i]["POD"]));
                if ((arg_dt.Rows[i]["POD"] == null || arg_dt.Rows[i]["POD"].ToString() == "" ? 0 : Convert.ToDouble(arg_dt.Rows[i]["POD"])) > Convert.ToDouble(arg_dt.Rows[0]["TARGET"]))
                {
                    series2.Points[i].Color = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(176)))), ((int)(((byte)(240)))));
                }
                else
                {
                    series2.Points[i].Color = Color.Red;
                }
            }

            (series2.Label as SideBySideBarSeriesLabel).Position = DevExpress.XtraCharts.BarSeriesLabelPosition.Top;

            // series2 = splineSeriesView1;
            // Add both series to the chart.
            //chartControl1.Series.AddRange(new Series[] { series1, series2 });


            arg_chart.SeriesSerializable = new DevExpress.XtraCharts.Series[] { series2 };
            ((XYDiagram)arg_chart.Diagram).AxisY.Title.Text       = "POD";
            ((XYDiagram)arg_chart.Diagram).AxisY.Title.TextColor  = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(176)))), ((int)(((byte)(240)))));
            ((XYDiagram)arg_chart.Diagram).AxisY.Title.Visibility = DevExpress.Utils.DefaultBoolean.Default;
            ((XYDiagram)arg_chart.Diagram).AxisX.Title.Text       = "Date";
            ((XYDiagram)arg_chart.Diagram).AxisX.Title.Visibility = DevExpress.Utils.DefaultBoolean.Default;
            ((XYDiagram)arg_chart.Diagram).AxisX.Title.TextColor  = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(176)))), ((int)(((byte)(240)))));

            ((XYDiagram)arg_chart.Diagram).AxisX.Tickmarks.MinorVisible = true;


            sideBySideBarSeriesView1.ColorEach = false;
            series2.View = sideBySideBarSeriesView1;

            //title
            DevExpress.XtraCharts.ChartTitle chartTitle2 = new DevExpress.XtraCharts.ChartTitle();
            chartTitle2.Alignment = System.Drawing.StringAlignment.Near;
            chartTitle2.Font      = new System.Drawing.Font("Tahoma", 24F, System.Drawing.FontStyle.Bold);
            chartTitle2.Text      = arg_name;
            chartTitle2.TextColor = System.Drawing.Color.Blue;
            arg_chart.Titles.AddRange(new DevExpress.XtraCharts.ChartTitle[] { chartTitle2 });


            series2.LabelsVisibility = DevExpress.Utils.DefaultBoolean.True;
            xySeriesUnwindAnimation1.EasingFunction = sineEasingFunction1; //powerEasingFunction1;
            //splineSeriesView1.SeriesAnimation = xySeriesUnwindAnimation1;//xySeriesBlowUpAnimation1;//xySeriesUnwindAnimation1; // xySeriesUnwrapAnimation1;

            arg_chart.Legend.Direction = LegendDirection.LeftToRight;

            //Constant line
            //constantLine1.ShowInLegend = false;
            constantLine1.AxisValueSerializable = arg_dt.Rows[0]["TARGET"].ToString();
            constantLine1.Color         = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(176)))), ((int)(((byte)(80)))));
            constantLine1.Name          = "Target";
            constantLine1.ShowBehind    = false;
            constantLine1.Title.Visible = false;
            //constantLine1.Title.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            //constantLine1.Title.Text = "Target";
            constantLine1.LineStyle.Thickness = 2;
            constantLine1.Title.Alignment     = DevExpress.XtraCharts.ConstantLineTitleAlignment.Far;
            ((XYDiagram)arg_chart.Diagram).AxisY.ConstantLines.Clear();
            ((XYDiagram)arg_chart.Diagram).AxisY.ConstantLines.AddRange(new DevExpress.XtraCharts.ConstantLine[] { constantLine1 });



            //((XYDiagram)arg_chart.Diagram).AxisX.NumericScaleOptions.AutoGrid = false;
            //((XYDiagram)arg_chart.Diagram).AxisX.VisualRange.Auto = false;
            //((XYDiagram)arg_chart.Diagram).AxisX.VisualRange.AutoSideMargins = false;
            //((XYDiagram)arg_chart.Diagram).AxisX.Label.Angle = 90;
            //((XYDiagram)arg_chart.Diagram).AxisX.Label.ResolveOverlappingOptions.AllowHide = false;
            //((XYDiagram)arg_chart.Diagram).AxisX.Label.ResolveOverlappingOptions.AllowStagger = true;
            ((XYDiagram)arg_chart.Diagram).AxisX.Tickmarks.MinorVisible = false;
            ((XYDiagram)arg_chart.Diagram).AxisX.GridLines.Visible      = false;

            ((XYDiagram)arg_chart.Diagram).AxisX.Label.Font = new System.Drawing.Font("Tahoma", 10, System.Drawing.FontStyle.Bold);
            //((XYDiagram)arg_chart.Diagram).AxisY.NumericScaleOptions.ScaleMode = DevExpress.XtraCharts.ScaleMode.Continuous;
            //((XYDiagram)_chartControl1.Diagram).AxisY.NumericScaleOptions.ScaleMode = DevExpress.XtraCharts.ScaleMode.Automatic;
            //((XYDiagram)arg_chart.Diagram).AxisX.
            ((XYDiagram)arg_chart.Diagram).AxisY.Label.Font = new System.Drawing.Font("Tahoma", 10, System.Drawing.FontStyle.Bold);

            ((XYDiagram)arg_chart.Diagram).AxisX.Title.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            ((XYDiagram)arg_chart.Diagram).AxisY.Title.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));



            pn_body.Controls.Add(arg_chart);
        }
        private void CreateChartBar(ChartControl arg_chart, DataTable arg_dt, string arg_name)
        {
            if (arg_dt == null || arg_dt.Rows.Count == 0)
            {
                return;
            }
            arg_chart.Series.Clear();
            arg_chart.Titles.Clear();
            arg_chart.Legend.CustomItems.Clear();
            Series series2 = new Series("POD", ViewType.Bar);

            //DevExpress.XtraCharts.XYSeriesBlowUpAnimation xySeriesBlowUpAnimation1 = new DevExpress.XtraCharts.XYSeriesBlowUpAnimation();
            DevExpress.XtraCharts.XYSeriesUnwindAnimation xySeriesUnwindAnimation1 = new DevExpress.XtraCharts.XYSeriesUnwindAnimation();
            //DevExpress.XtraCharts.XYSeriesUnwrapAnimation xySeriesUnwrapAnimation1 = new DevExpress.XtraCharts.XYSeriesUnwrapAnimation();

            //DevExpress.XtraCharts.PowerEasingFunction powerEasingFunction1 = new DevExpress.XtraCharts.PowerEasingFunction();
            DevExpress.XtraCharts.SineEasingFunction sineEasingFunction1 = new DevExpress.XtraCharts.SineEasingFunction();
            DevExpress.XtraCharts.ConstantLine       constantLine1       = new DevExpress.XtraCharts.ConstantLine();

            DevExpress.XtraCharts.CustomLegendItem customLegendItem1 = new DevExpress.XtraCharts.CustomLegendItem();
            DevExpress.XtraCharts.CustomLegendItem customLegendItem2 = new DevExpress.XtraCharts.CustomLegendItem();
            DevExpress.XtraCharts.CustomLegendItem customLegendItem3 = new DevExpress.XtraCharts.CustomLegendItem();
            DevExpress.XtraCharts.CustomLegendItem customLegendItem4 = new DevExpress.XtraCharts.CustomLegendItem();



            // Add points to them, with their arguments different.

            for (int i = 0; i < arg_dt.Rows.Count; i++)
            {
                //series1.Points.Add(new SeriesPoint(dt.Rows[i]["HMS"].ToString(), dt.Rows[i]["QTY"])); //GetRandomNumber(10, 50)
                series2.Points.Add(new SeriesPoint(arg_dt.Rows[i]["DD"].ToString() + "\n" + arg_dt.Rows[i]["DY"].ToString(),
                                                   arg_dt.Rows[i]["POD"] == null || arg_dt.Rows[i]["POD"].ToString() == "" ? 0 : arg_dt.Rows[i]["POD"]));


                if (arg_dt.Rows[i]["POD"] != null && arg_dt.Rows[i]["POD"].ToString() != "")
                {
                    series2.Points[i].Color = Color.FromName(arg_dt.Rows[i]["COLOR"].ToString());
                }
                else
                {
                    series2.Points[i].Color = Color.Empty;
                }
            }

            series2.Points.Add(new SeriesPoint(" "));


            arg_chart.SeriesSerializable = new DevExpress.XtraCharts.Series[] { series2 };
            ((XYDiagram)arg_chart.Diagram).AxisY.Title.Text             = "POD";
            ((XYDiagram)arg_chart.Diagram).AxisY.Title.TextColor        = System.Drawing.Color.Orange;
            ((XYDiagram)arg_chart.Diagram).AxisY.Title.Visibility       = DevExpress.Utils.DefaultBoolean.Default;
            ((XYDiagram)arg_chart.Diagram).AxisX.Title.Text             = "Date";
            ((XYDiagram)arg_chart.Diagram).AxisX.Title.Visibility       = DevExpress.Utils.DefaultBoolean.Default;
            ((XYDiagram)arg_chart.Diagram).AxisX.Title.TextColor        = System.Drawing.Color.Orange;
            ((XYDiagram)arg_chart.Diagram).AxisX.Tickmarks.MinorVisible = false;

            //title
            DevExpress.XtraCharts.ChartTitle chartTitle2 = new DevExpress.XtraCharts.ChartTitle();
            chartTitle2.Alignment = System.Drawing.StringAlignment.Near;
            chartTitle2.Font      = new System.Drawing.Font("Tahoma", 24F, System.Drawing.FontStyle.Bold);
            chartTitle2.Text      = arg_name;
            chartTitle2.TextColor = System.Drawing.Color.Black;
            arg_chart.Titles.AddRange(new DevExpress.XtraCharts.ChartTitle[] { chartTitle2 });

            series2.LabelsVisibility = DevExpress.Utils.DefaultBoolean.True;
            //series2.Label.ResolveOverlappingMode = ResolveOverlappingMode.JustifyAllAroundPoint;
            xySeriesUnwindAnimation1.EasingFunction = sineEasingFunction1; //powerEasingFunction1;

            //arg_chart.Legend.CustomItems.AddRange(new DevExpress.XtraCharts.CustomLegendItem[] {
            //customLegendItem1,
            //customLegendItem2,
            //customLegendItem3});


            // arg_chart.Legend.CustomItems[0].Text = "<8.0";
            series2.ShowInLegend       = false;
            arg_chart.Legend.Direction = LegendDirection.LeftToRight;

            //Constant line
            //constantLine1.ShowInLegend = false;
            constantLine1.AxisValueSerializable = arg_dt.Rows[0]["TAR_GREEN"].ToString();
            constantLine1.Color               = Color.DodgerBlue;
            constantLine1.Name                = "Target";
            constantLine1.ShowBehind          = false;
            constantLine1.Title.Font          = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            constantLine1.Title.Text          = arg_dt.Rows[0]["TAR_GREEN"].ToString();
            constantLine1.Title.Visible       = true;
            constantLine1.LineStyle.Thickness = 2;
            constantLine1.Title.Alignment     = DevExpress.XtraCharts.ConstantLineTitleAlignment.Far;


            //Legend
            customLegendItem1.MarkerColor = System.Drawing.Color.Red;
            customLegendItem1.Text        = "<" + arg_dt.Rows[0]["TAR_YELLOW"].ToString();
            customLegendItem2.MarkerColor = System.Drawing.Color.Yellow;
            customLegendItem2.Text        = arg_dt.Rows[0]["TAR_YELLOW"].ToString() + " ~ " + arg_dt.Rows[0]["TAR_GREEN"].ToString();
            customLegendItem3.MarkerColor = System.Drawing.Color.Green;
            customLegendItem3.Text        = ">" + arg_dt.Rows[0]["TAR_GREEN"].ToString();
            customLegendItem4.MarkerColor = System.Drawing.Color.DodgerBlue;
            customLegendItem4.Text        = "Target";

            arg_chart.Legend.CustomItems.AddRange(new DevExpress.XtraCharts.CustomLegendItem[] {
                customLegendItem1,
                customLegendItem2,
                customLegendItem3,
                customLegendItem4
            });


            //((XYDiagram)arg_chart.Diagram).AxisY.WholeRange.MinValue = 0;
            //((XYDiagram)arg_chart.Diagram).AxisY.WholeRange.MaxValue = arg_dt.Rows[0]["TARGET"].ToString() + 10;
            ((XYDiagram)arg_chart.Diagram).AxisY.ConstantLines.Clear();
            ((XYDiagram)arg_chart.Diagram).AxisY.ConstantLines.AddRange(new DevExpress.XtraCharts.ConstantLine[] { constantLine1 });
            // ((XYDiagram)arg_chart.Diagram).AxisX.VisualRange.Auto = true;
            ((XYDiagram)arg_chart.Diagram).AxisX.VisualRange.AutoSideMargins  = false;
            ((XYDiagram)arg_chart.Diagram).AxisX.VisualRange.SideMarginsValue = 2;
            ((XYDiagram)arg_chart.Diagram).AxisX.Label.Angle = 0;
            ((XYDiagram)arg_chart.Diagram).AxisX.Label.Font  = new System.Drawing.Font("Tahoma", 10, System.Drawing.FontStyle.Bold);
            ((XYDiagram)arg_chart.Diagram).AxisX.NumericScaleOptions.ScaleMode = DevExpress.XtraCharts.ScaleMode.Continuous;
            //((XYDiagram)_chartControl1.Diagram).AxisY.NumericScaleOptions.ScaleMode = DevExpress.XtraCharts.ScaleMode.Automatic;
            ((XYDiagram)arg_chart.Diagram).AxisY.Label.Font = new System.Drawing.Font("Tahoma", 10, System.Drawing.FontStyle.Bold);

            ((XYDiagram)arg_chart.Diagram).AxisX.Title.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            ((XYDiagram)arg_chart.Diagram).AxisY.Title.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));

            pn_body.Controls.Add(arg_chart);
        }
示例#16
0
        private void CreatAllCustomer(DateTime starttime, DateTime endtime)
        {
            string        constr = "server=192.168.0.176;database=BarcodeNew;user id=sa;password=The0more7people0you7love3the7weaker8you8are;Pooling=false";
            SqlConnection con    = new SqlConnection(constr);

            con.Open();
            string         sql = "QMS_OQCforallcustomer";
            SqlCommand     cmd = new SqlCommand(sql, con);
            SqlDataAdapter da  = new SqlDataAdapter(cmd);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@ustarttime", starttime.Date);
            cmd.Parameters.AddWithValue("@uendtime", endtime.AddDays(1).Date);
            gridView1.Columns.Clear();
            DataTable dt = new DataTable();

            da.Fill(dt);
            gridControl1.DataSource = dt;
            gridView1.Appearance.Row.TextOptions.HAlignment         = DevExpress.Utils.HorzAlignment.Center;
            gridView1.Appearance.HeaderPanel.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
            con.Close();
            //创建图表
            DevExpress.XtraCharts.ChartTitle chartTitle = new DevExpress.XtraCharts.ChartTitle();
            // ChartTitle chartTitle = new ChartTitle();
            chartTitle.Text      = starttime.ToShortDateString().ToString() + "至" + endtime.ToShortDateString().ToString() + " EMS各客户出货检验报表"; //标题内容
            chartTitle.TextColor = System.Drawing.Color.Black;                                                                                //颜色设置
            chartTitle.Font      = new Font("Tahoma", 12);                                                                                    //字体类型字号
            chartTitle.Alignment = StringAlignment.Center;
            chartControl1.Titles.Clear();
            chartControl1.Titles.Add(chartTitle);
            chartControl1.Series.Clear();
            //实例化图表元素
            Series series1 = CreateSeries("检验批数", ViewType.Bar, dt);

            chartControl1.Series.Add(series1);
            Series series2 = CreateSeries1("不良批数", ViewType.Bar, dt);

            chartControl1.Series.Add(series2);
            Series series3 = CreateSeries4(ViewType.Line, dt);

            chartControl1.Series.Add(series3);
            //series3.View.Color = Color.Black;

            //series3.PointOptions.ValueNumericOptions.Format = NumericFormat.Percent;//series3显示百分号
            ((XYDiagram)chartControl1.Diagram).SecondaryAxesY.Clear();
            SecondaryAxisY myAxisY = new SecondaryAxisY();

            ((XYDiagram)chartControl1.Diagram).SecondaryAxesY.Add(myAxisY);
            ((LineSeriesView)series3.View).AxisY = myAxisY;
            myAxisY.Color = Color.Red;
            ((LineSeriesView)series3.View).LineMarkerOptions.Color = Color.Red;
            myAxisY.NumericOptions.Format = DevExpress.XtraCharts.NumericFormat.Percent;//显示为百分数
            double max = 1;
            double min = 1;

            foreach (DataRow dr in dt.Rows)
            {
                string str1  = Convert.ToString(dr[3]).TrimEnd('%');
                double value = Convert.ToDouble(str1) / 100;
                if (value < min)
                {
                    min = value;
                }
            }
            if (min > 0.1)
            {
                min = min - 0.06;
            }
            myAxisY.Range.MinValue = min;
            myAxisY.Range.MaxValue = max;
            ((LineSeriesView)series3.View).LineMarkerOptions.Color = Color.Red;
            Series series4 = CreateSeries5(ViewType.Line, dt);

            chartControl1.Series.Add(series4);
            ((LineSeriesView)series4.View).AxisY = myAxisY;
            // series4.View.Color = Color.Red;//将目标批合格率的线条改为红色。
        }
        private void CreateChartBar2(ChartControl arg_chart, DataTable arg_dt, string arg_name)
        {
            try
            {
                if (arg_dt == null || arg_dt.Rows.Count == 0)
                {
                    return;
                }
                arg_chart.Series.Clear();
                arg_chart.Titles.Clear();
                arg_chart.Legend.CustomItems.Clear();
                Series series1 = new Series("Lean LD", ViewType.Bar);
                Series series2 = new Series("Lean LE", ViewType.Bar);
                //Series series3 = new Series("Lean I", ViewType.Bar);
                //Series series4 = new Series("Lean J", ViewType.Bar);
                //Series series5 = new Series("Lean K", ViewType.Bar);
                //Series series6 = new Series("Lean T", ViewType.Bar);

                //DevExpress.XtraCharts.XYSeriesBlowUpAnimation xySeriesBlowUpAnimation1 = new DevExpress.XtraCharts.XYSeriesBlowUpAnimation();
                DevExpress.XtraCharts.XYSeriesUnwindAnimation xySeriesUnwindAnimation1 = new DevExpress.XtraCharts.XYSeriesUnwindAnimation();
                //DevExpress.XtraCharts.XYSeriesUnwrapAnimation xySeriesUnwrapAnimation1 = new DevExpress.XtraCharts.XYSeriesUnwrapAnimation();

                //DevExpress.XtraCharts.PowerEasingFunction powerEasingFunction1 = new DevExpress.XtraCharts.PowerEasingFunction();
                DevExpress.XtraCharts.SineEasingFunction sineEasingFunction1 = new DevExpress.XtraCharts.SineEasingFunction();
                DevExpress.XtraCharts.ConstantLine       constantLine1       = new DevExpress.XtraCharts.ConstantLine();

                DevExpress.XtraCharts.CustomLegendItem customLegendItem1 = new DevExpress.XtraCharts.CustomLegendItem();
                DevExpress.XtraCharts.CustomLegendItem customLegendItem2 = new DevExpress.XtraCharts.CustomLegendItem();
                DevExpress.XtraCharts.CustomLegendItem customLegendItem3 = new DevExpress.XtraCharts.CustomLegendItem();
                DevExpress.XtraCharts.CustomLegendItem customLegendItem4 = new DevExpress.XtraCharts.CustomLegendItem();



                // Add points to them, with their arguments different.
                int irow = 0;
                for (int i = 0; i < arg_dt.Rows.Count; i++)
                {
                    //series2.Points.Add(new SeriesPoint(arg_dt.Rows[i]["DD"].ToString() + "\n" + arg_dt.Rows[i]["DY"].ToString(),
                    //                                   arg_dt.Rows[i]["POD"] == null || arg_dt.Rows[i]["POD"].ToString() == "" ? 0 : arg_dt.Rows[i]["POD"]));
                    //if (arg_dt.Rows[i]["POD"] != null && arg_dt.Rows[i]["POD"].ToString() != "")
                    //    series2.Points[i].Color = Color.FromName(arg_dt.Rows[i]["COLOR"].ToString());
                    //else
                    //    series2.Points[i].Color = Color.Empty;

                    switch (arg_dt.Rows[i]["RN"].ToString())
                    {
                    case "1":
                        add_series(ref series1, arg_dt, irow, i);
                        break;

                    case "2":
                        add_series(ref series2, arg_dt, irow, i);
                        break;
                        //case "3":
                        //    add_series(ref series3, arg_dt, irow, i);
                        //    break;
                        //case "4":
                        //    add_series(ref series4, arg_dt, irow, i);
                        //    break;
                        //case "5":
                        //    add_series(ref series5, arg_dt, irow, i);
                        //    break;
                        //case "6":
                        //    add_series(ref series6, arg_dt, irow, i);
                        //    break;
                    }
                    if (i + 1 < arg_dt.Rows.Count && arg_dt.Rows[i + 1]["DD"].ToString() != arg_dt.Rows[i]["DD"].ToString())
                    {
                        irow++;
                    }
                }

                series1.Points.Add(new SeriesPoint(" "));

                series1.LabelsVisibility  = DevExpress.Utils.DefaultBoolean.True;
                series1.Label.TextPattern = "{S}";
                ((SideBySideBarSeriesLabel)series1.Label).Position = BarSeriesLabelPosition.Top;
                series1.Label.TextOrientation = TextOrientation.BottomToTop;

                series2.LabelsVisibility  = DevExpress.Utils.DefaultBoolean.True;
                series2.Label.TextPattern = "{S}";
                ((SideBySideBarSeriesLabel)series2.Label).Position = BarSeriesLabelPosition.Top;
                series2.Label.TextOrientation = TextOrientation.BottomToTop;

                //series3.LabelsVisibility = DevExpress.Utils.DefaultBoolean.True;
                //series3.Label.TextPattern = "{S}";
                //((SideBySideBarSeriesLabel)series3.Label).Position = BarSeriesLabelPosition.Top;
                //series3.Label.TextOrientation = TextOrientation.BottomToTop;

                //series4.LabelsVisibility = DevExpress.Utils.DefaultBoolean.True;
                //series4.Label.TextPattern = "{S}";
                //((SideBySideBarSeriesLabel)series4.Label).Position = BarSeriesLabelPosition.Top;
                //series4.Label.TextOrientation = TextOrientation.BottomToTop;

                //series5.LabelsVisibility = DevExpress.Utils.DefaultBoolean.True;
                //series5.Label.TextPattern = "{S}";
                //((SideBySideBarSeriesLabel)series5.Label).Position = BarSeriesLabelPosition.Top;
                //series5.Label.TextOrientation = TextOrientation.BottomToTop;

                //series6.LabelsVisibility = DevExpress.Utils.DefaultBoolean.True;
                //series6.Label.TextPattern = "{S}";
                //((SideBySideBarSeriesLabel)series6.Label).Position = BarSeriesLabelPosition.Top;
                //series6.Label.TextOrientation = TextOrientation.BottomToTop;


                arg_chart.SeriesSerializable = new DevExpress.XtraCharts.Series[] { series1, series2 };
                ((XYDiagram)arg_chart.Diagram).AxisY.Title.Text             = "POD";
                ((XYDiagram)arg_chart.Diagram).AxisY.Title.TextColor        = System.Drawing.Color.Orange;
                ((XYDiagram)arg_chart.Diagram).AxisY.Title.Visibility       = DevExpress.Utils.DefaultBoolean.Default;
                ((XYDiagram)arg_chart.Diagram).AxisX.Title.Text             = "Date";
                ((XYDiagram)arg_chart.Diagram).AxisX.Title.Visibility       = DevExpress.Utils.DefaultBoolean.Default;
                ((XYDiagram)arg_chart.Diagram).AxisX.Title.TextColor        = System.Drawing.Color.Orange;
                ((XYDiagram)arg_chart.Diagram).AxisX.Tickmarks.MinorVisible = false;

                //title
                DevExpress.XtraCharts.ChartTitle chartTitle2 = new DevExpress.XtraCharts.ChartTitle();
                chartTitle2.Alignment = System.Drawing.StringAlignment.Near;
                chartTitle2.Font      = new System.Drawing.Font("Tahoma", 24F, System.Drawing.FontStyle.Bold);
                chartTitle2.Text      = arg_name;
                chartTitle2.TextColor = System.Drawing.Color.Black;
                arg_chart.Titles.AddRange(new DevExpress.XtraCharts.ChartTitle[] { chartTitle2 });



                xySeriesUnwindAnimation1.EasingFunction = sineEasingFunction1; //powerEasingFunction1;

                series1.ShowInLegend       = false;
                arg_chart.Legend.Direction = LegendDirection.LeftToRight;

                //Constant line
                //constantLine1.ShowInLegend = false;
                constantLine1.AxisValueSerializable = arg_dt.Rows[0]["TAR_GREEN"].ToString();
                constantLine1.Color               = Color.DodgerBlue;
                constantLine1.Name                = "Target";
                constantLine1.ShowBehind          = false;
                constantLine1.Title.Font          = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                constantLine1.Title.Text          = arg_dt.Rows[0]["TAR_GREEN"].ToString();
                constantLine1.Title.Visible       = true;
                constantLine1.LineStyle.Thickness = 2;
                constantLine1.Title.Alignment     = DevExpress.XtraCharts.ConstantLineTitleAlignment.Far;


                //Legend
                customLegendItem1.MarkerColor = System.Drawing.Color.Red;
                customLegendItem1.Text        = "<" + arg_dt.Rows[0]["TAR_YELLOW"].ToString();
                customLegendItem2.MarkerColor = System.Drawing.Color.Yellow;
                customLegendItem2.Text        = arg_dt.Rows[0]["TAR_YELLOW"].ToString() + " ~ " + arg_dt.Rows[0]["TAR_GREEN"].ToString();
                customLegendItem3.MarkerColor = System.Drawing.Color.Green;
                customLegendItem3.Text        = ">" + arg_dt.Rows[0]["TAR_GREEN"].ToString();
                customLegendItem4.MarkerColor = System.Drawing.Color.DodgerBlue;
                customLegendItem4.Text        = "Target";

                arg_chart.Legend.CustomItems.AddRange(new DevExpress.XtraCharts.CustomLegendItem[] {
                    customLegendItem1,
                    customLegendItem2,
                    customLegendItem3,
                    customLegendItem4
                });


                //((XYDiagram)arg_chart.Diagram).AxisY.WholeRange.MinValue = 0;
                //((XYDiagram)arg_chart.Diagram).AxisY.WholeRange.MaxValue = arg_dt.Rows[0]["TARGET"].ToString() + 10;
                ((XYDiagram)arg_chart.Diagram).AxisY.ConstantLines.Clear();
                ((XYDiagram)arg_chart.Diagram).AxisY.ConstantLines.AddRange(new DevExpress.XtraCharts.ConstantLine[] { constantLine1 });
                // ((XYDiagram)arg_chart.Diagram).AxisX.VisualRange.Auto = true;
                ((XYDiagram)arg_chart.Diagram).AxisX.VisualRange.AutoSideMargins  = false;
                ((XYDiagram)arg_chart.Diagram).AxisX.VisualRange.SideMarginsValue = 2;
                ((XYDiagram)arg_chart.Diagram).AxisX.Label.Angle = 0;
                ((XYDiagram)arg_chart.Diagram).AxisX.Label.Font  = new System.Drawing.Font("Tahoma", 10, System.Drawing.FontStyle.Bold);
                ((XYDiagram)arg_chart.Diagram).AxisX.NumericScaleOptions.ScaleMode = DevExpress.XtraCharts.ScaleMode.Continuous;
                //((XYDiagram)_chartControl1.Diagram).AxisY.NumericScaleOptions.ScaleMode = DevExpress.XtraCharts.ScaleMode.Automatic;
                ((XYDiagram)arg_chart.Diagram).AxisY.Label.Font = new System.Drawing.Font("Tahoma", 10, System.Drawing.FontStyle.Bold);

                ((XYDiagram)arg_chart.Diagram).AxisX.Title.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                ((XYDiagram)arg_chart.Diagram).AxisY.Title.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));

                //pn_body.Controls.Add(arg_chart);
            }
            catch
            {
            }
        }
示例#18
0
        private void Graph_Init_for_TTA(TTA_measurement myTTA)
        {
            //Zwischenspeicher umschreiben
            akt_Graph_Setup = "TTA";

            //Größe der Überschriften
            Font myFont_Headline = new Font("Tahoma", 12, FontStyle.Bold);
            Font myFont_Axis     = new Font("Tahoma", 10);

            DevExpress.XtraCharts.ChartTitle myChartTitle;

            //Ober Graph für RAW............................................................................
            chartControl_RAW.Series.Clear();

            myChartTitle = new DevExpress.XtraCharts.ChartTitle()
            {
                Text = "Raw Values DAC",
                Font = myFont_Headline,
                Dock = DevExpress.XtraCharts.ChartTitleDockStyle.Top,
            };

            chartControl_RAW.Titles.Clear();
            chartControl_RAW.Titles.Add(myChartTitle);

            //Diagramm erzeugen (Muss wegen laufzeit in Begin Init und EndInit)
            XYDiagram xyDigaram_RAW;

            ((System.ComponentModel.ISupportInitialize)(this.chartControl_RAW)).BeginInit();
            xyDigaram_RAW            = new XYDiagram();
            chartControl_RAW.Diagram = xyDigaram_RAW;


            //Achsen-Titel setzen
            xyDigaram_RAW.AxisX.Title.Text       = "Time in [s]";
            xyDigaram_RAW.AxisX.Title.Visibility = DevExpress.Utils.DefaultBoolean.True;
            xyDigaram_RAW.AxisX.Title.Font       = myFont_Axis;
            xyDigaram_RAW.AxisY.Title.Text       = "Bit-Value";
            xyDigaram_RAW.AxisY.Title.Visibility = DevExpress.Utils.DefaultBoolean.True;
            xyDigaram_RAW.AxisY.Title.Font       = myFont_Axis;

            //Min-Max - Achse
            decimal zeit_max = (myTTA.MyRack.Time_Heat + myTTA.MyRack.Time_Meas) / 1000;

            xyDigaram_RAW.AxisX.VisibleInPanesSerializable   = "-1";
            xyDigaram_RAW.AxisX.VisualRange.Auto             = false;
            xyDigaram_RAW.AxisX.WholeRange.MaxValue          = zeit_max * 2; //Zugelassener Bereich
            xyDigaram_RAW.AxisX.WholeRange.MinValue          = 0;
            xyDigaram_RAW.AxisX.VisualRange.MaxValue         = zeit_max;     //Sichtbarrer Bereich
            xyDigaram_RAW.AxisX.VisualRange.MinValue         = 0;
            xyDigaram_RAW.AxisX.VisualRange.SideMarginsValue = 0;            //Überstand Links und rechts


            xyDigaram_RAW.AxisY.VisibleInPanesSerializable      = "-1";
            xyDigaram_RAW.AxisY.VisualRange.Auto                = false;
            xyDigaram_RAW.AxisY.WholeRange.MaxValue             = 32768;
            xyDigaram_RAW.AxisY.WholeRange.MinValue             = -32768;
            xyDigaram_RAW.AxisY.VisualRange.MaxValue            = 32768; //Sichtbarrer Bereich
            xyDigaram_RAW.AxisY.VisualRange.MinValue            = -32768;
            xyDigaram_RAW.AxisY.NumericScaleOptions.AutoGrid    = false;
            xyDigaram_RAW.AxisY.NumericScaleOptions.GridSpacing = 16384;
            xyDigaram_RAW.AxisY.Interlaced = true;
            xyDigaram_RAW.AxisY.VisualRange.SideMarginsValue = 1;     //Überstand Links und rechts

            ((System.ComponentModel.ISupportInitialize)(this.chartControl_RAW)).EndInit();

            //Label & Legend
            chartControl_RAW.CrosshairOptions.GroupHeaderPattern = "{A} sec";
            chartControl_RAW.CrosshairOptions.HighlightPoints    = false;

            chartControl_RAW.Legend.MarkerMode = LegendMarkerMode.CheckBox;

            //Hinzufügen leere unsichbare Serie (damit Achsen angezeigt werden)
            var neueSerie = new Series("Empty", ViewType.Line)
            {
                LabelsVisibility = DevExpress.Utils.DefaultBoolean.False,
                ShowInLegend     = false,
                Visible          = true,
            };

            chartControl_RAW.Series.Add(neueSerie);


            //Ober Graph für RAW................................................................................
            chartControl_DATA_Top.Series.Clear();

            myChartTitle = new DevExpress.XtraCharts.ChartTitle()
            {
                Text = "Z_th curve for heating",
                Font = myFont_Headline,
                Dock = DevExpress.XtraCharts.ChartTitleDockStyle.Top
            };

            chartControl_DATA_Top.Titles.Clear();
            chartControl_DATA_Top.Titles.Add(myChartTitle);

            //Diagramm erzeugen (Muss wegen laufzeit in Begin Init und EndInit)
            XYDiagram xyDiagram_DATA_Top;

            ((System.ComponentModel.ISupportInitialize)(this.chartControl_DATA_Top)).BeginInit();
            xyDiagram_DATA_Top            = new XYDiagram();
            chartControl_DATA_Top.Diagram = xyDiagram_DATA_Top;


            //Achsen-Titel setzen
            xyDiagram_DATA_Top.AxisX.Title.Text       = "Time in [s]";
            xyDiagram_DATA_Top.AxisX.Title.Visibility = DevExpress.Utils.DefaultBoolean.True;
            xyDiagram_DATA_Top.AxisX.Title.Font       = myFont_Axis;
            xyDiagram_DATA_Top.AxisY.Title.Text       = "Voltage [V]";
            xyDiagram_DATA_Top.AxisY.Title.Visibility = DevExpress.Utils.DefaultBoolean.True;
            xyDiagram_DATA_Top.AxisY.Title.Font       = myFont_Axis;

            //Min-Max - Achse
            xyDiagram_DATA_Top.AxisX.VisibleInPanesSerializable   = "-1";
            xyDiagram_DATA_Top.AxisX.VisualRange.Auto             = false;
            xyDiagram_DATA_Top.AxisX.WholeRange.MaxValue          = myTTA.MyRack.Time_Heat / 1000;   //Zugelassener Bereich
            xyDiagram_DATA_Top.AxisX.WholeRange.MinValue          = 1m / myTTA.MyDAQ.Frequency;
            xyDiagram_DATA_Top.AxisX.VisualRange.MaxValue         = myTTA.MyRack.Time_Heat / 1000;   //Sichtbarrer Bereich
            xyDiagram_DATA_Top.AxisX.VisualRange.MinValue         = 1m / myTTA.MyDAQ.Frequency;
            xyDiagram_DATA_Top.AxisX.VisualRange.SideMarginsValue = 0;                               //Überstand Links und rechts
            xyDiagram_DATA_Top.AxisX.Logarithmic = true;


            xyDiagram_DATA_Top.AxisY.VisibleInPanesSerializable      = "-1";
            xyDiagram_DATA_Top.AxisY.VisualRange.Auto                = false;
            xyDiagram_DATA_Top.AxisY.WholeRange.MaxValue             = 10;
            xyDiagram_DATA_Top.AxisY.WholeRange.MinValue             = 0;
            xyDiagram_DATA_Top.AxisY.VisualRange.MaxValue            = 10; //Sichtbarrer Bereich
            xyDiagram_DATA_Top.AxisY.VisualRange.MinValue            = 0;
            xyDiagram_DATA_Top.AxisY.NumericScaleOptions.GridSpacing = 1;
            xyDiagram_DATA_Top.AxisY.VisualRange.SideMarginsValue    = 0;  //Überstand Links und rechts

            ((System.ComponentModel.ISupportInitialize)(this.chartControl_DATA_Top)).EndInit();

            //Label & Legend
            chartControl_DATA_Top.CrosshairOptions.GroupHeaderPattern = "{A} sec";
            chartControl_DATA_Top.CrosshairOptions.HighlightPoints    = false;

            chartControl_DATA_Top.Legend.MarkerMode = LegendMarkerMode.CheckBox;

            //Hinzufügen leere unsichbare Serie (damit Achsen angezeigt werden)
            neueSerie = new Series("Empty", ViewType.Line)
            {
                LabelsVisibility = DevExpress.Utils.DefaultBoolean.False,
                ShowInLegend     = false,
                Visible          = true,
            };
            chartControl_DATA_Top.Series.Add(neueSerie);


            //Ober Graph für RAW...................................................................................
            chartControl_DATA_Bottom.Series.Clear();

            myChartTitle = new DevExpress.XtraCharts.ChartTitle()
            {
                Text = "Z_th curve for cooling",
                Font = myFont_Headline,
                Dock = DevExpress.XtraCharts.ChartTitleDockStyle.Top
            };

            chartControl_DATA_Bottom.Titles.Clear();
            chartControl_DATA_Bottom.Titles.Add(myChartTitle);

            //Diagramm erzeugen (Muss wegen laufzeit in Begin Init und EndInit)
            XYDiagram xyDiagram_DATA_Bottom;

            ((System.ComponentModel.ISupportInitialize)(this.chartControl_DATA_Bottom)).BeginInit();
            xyDiagram_DATA_Bottom            = new XYDiagram();
            chartControl_DATA_Bottom.Diagram = xyDiagram_DATA_Bottom;


            //Achsen-Titel setzen
            xyDiagram_DATA_Bottom.AxisX.Title.Text       = "Time in [s]";
            xyDiagram_DATA_Bottom.AxisX.Title.Visibility = DevExpress.Utils.DefaultBoolean.True;
            xyDiagram_DATA_Bottom.AxisX.Title.Font       = myFont_Axis;
            xyDiagram_DATA_Bottom.AxisY.Title.Text       = "Voltage [V]";
            xyDiagram_DATA_Bottom.AxisY.Title.Visibility = DevExpress.Utils.DefaultBoolean.True;
            xyDiagram_DATA_Bottom.AxisY.Title.Font       = myFont_Axis;

            //Min-Max - Achse
            xyDiagram_DATA_Bottom.AxisX.VisibleInPanesSerializable   = "-1";
            xyDiagram_DATA_Bottom.AxisX.VisualRange.Auto             = false;
            xyDiagram_DATA_Bottom.AxisX.WholeRange.MaxValue          = myTTA.MyRack.Time_Heat / 1000;   //Zugelassener Bereich
            xyDiagram_DATA_Bottom.AxisX.WholeRange.MinValue          = 1m / myTTA.MyDAQ.Frequency;
            xyDiagram_DATA_Bottom.AxisX.VisualRange.MaxValue         = myTTA.MyRack.Time_Heat / 1000;   //Sichtbarrer Bereich
            xyDiagram_DATA_Bottom.AxisX.VisualRange.MinValue         = 1m / myTTA.MyDAQ.Frequency;
            xyDiagram_DATA_Bottom.AxisX.VisualRange.SideMarginsValue = 0;                               //Überstand Links und rechts
            xyDiagram_DATA_Bottom.AxisX.Logarithmic = true;


            xyDiagram_DATA_Bottom.AxisY.VisibleInPanesSerializable      = "-1";
            xyDiagram_DATA_Bottom.AxisY.VisualRange.Auto                = true;
            xyDiagram_DATA_Bottom.AxisY.WholeRange.MaxValue             = 10;
            xyDiagram_DATA_Bottom.AxisY.WholeRange.MinValue             = 0;
            xyDiagram_DATA_Bottom.AxisY.VisualRange.MaxValue            = 10; //Sichtbarrer Bereich
            xyDiagram_DATA_Bottom.AxisY.VisualRange.MinValue            = 0;
            xyDiagram_DATA_Bottom.AxisY.NumericScaleOptions.GridSpacing = 1;
            xyDiagram_DATA_Bottom.AxisY.VisualRange.SideMarginsValue    = 0;  //Überstand Links und rechts

            ((System.ComponentModel.ISupportInitialize)(this.chartControl_DATA_Bottom)).EndInit();

            //Label & Legend
            chartControl_DATA_Bottom.CrosshairOptions.GroupHeaderPattern = "{A} sec";
            chartControl_DATA_Bottom.CrosshairOptions.HighlightPoints    = false;

            chartControl_DATA_Bottom.Legend.MarkerMode = LegendMarkerMode.CheckBox;

            //Hinzufügen leere unsichbare Serie (damit Achsen angezeigt werden)
            neueSerie = new Series("Empty", ViewType.Line)
            {
                LabelsVisibility = DevExpress.Utils.DefaultBoolean.False,
                ShowInLegend     = false,
                Visible          = true,
            };
            chartControl_DATA_Bottom.Series.Add(neueSerie);
        }
示例#19
0
        private void CreateChartLine(ChartControl arg_chart, DataTable arg_dt, string arg_name)
        {
            if (arg_dt == null || arg_dt.Rows.Count == 0)
            {
                return;
            }
            arg_chart.Series.Clear();
            arg_chart.Titles.Clear();

            //----------create--------------------
            Series series2 = new Series("POD", ViewType.Spline);

            DevExpress.XtraCharts.SplineSeriesView splineSeriesView1 = new DevExpress.XtraCharts.SplineSeriesView();
            //DevExpress.XtraCharts.SideBySideBarSeriesView sideBySideBarSeriesView1 = new DevExpress.XtraCharts.SideBySideBarSeriesView();
            //DevExpress.XtraCharts.PointSeriesLabel pointSeriesLabel1 = new DevExpress.XtraCharts.PointSeriesLabel();
            //DevExpress.XtraCharts.BarWidenAnimation barWidenAnimation1 = new DevExpress.XtraCharts.BarWidenAnimation();
            //DevExpress.XtraCharts.ElasticEasingFunction elasticEasingFunction1 = new DevExpress.XtraCharts.ElasticEasingFunction();
            //DevExpress.XtraCharts.XYSeriesBlowUpAnimation xySeriesBlowUpAnimation1 = new DevExpress.XtraCharts.XYSeriesBlowUpAnimation();
            DevExpress.XtraCharts.XYSeriesUnwindAnimation xySeriesUnwindAnimation1 = new DevExpress.XtraCharts.XYSeriesUnwindAnimation();
            //DevExpress.XtraCharts.XYSeriesUnwrapAnimation xySeriesUnwrapAnimation1 = new DevExpress.XtraCharts.XYSeriesUnwrapAnimation();
            //DevExpress.XtraCharts.PowerEasingFunction powerEasingFunction1 = new DevExpress.XtraCharts.PowerEasingFunction();
            DevExpress.XtraCharts.SineEasingFunction sineEasingFunction1 = new DevExpress.XtraCharts.SineEasingFunction();
            DevExpress.XtraCharts.ConstantLine       constantLine1       = new DevExpress.XtraCharts.ConstantLine();

            //--------- Add data Point------------
            for (int i = 0; i < arg_dt.Rows.Count; i++)
            {
                if (arg_dt.Rows[i]["POD"] == null || arg_dt.Rows[i]["POD"].ToString() == "")
                {
                    series2.Points.Add(new SeriesPoint(arg_dt.Rows[i]["LB"].ToString().Replace("_", "\n")));
                }
                else
                {
                    series2.Points.Add(new SeriesPoint(arg_dt.Rows[i]["LB"].ToString().Replace("_", "\n"), arg_dt.Rows[i]["POD"]));
                }
            }

            arg_chart.SeriesSerializable = new DevExpress.XtraCharts.Series[] { series2 };



            //title
            DevExpress.XtraCharts.ChartTitle chartTitle2 = new DevExpress.XtraCharts.ChartTitle();
            chartTitle2.Alignment = System.Drawing.StringAlignment.Near;
            chartTitle2.Font      = new System.Drawing.Font("Calibri", 24F, System.Drawing.FontStyle.Bold);
            chartTitle2.Text      = arg_name;
            chartTitle2.TextColor = System.Drawing.Color.Black;
            arg_chart.Titles.AddRange(new DevExpress.XtraCharts.ChartTitle[] { chartTitle2 });


            // format Series
            splineSeriesView1.MarkerVisibility = DevExpress.Utils.DefaultBoolean.True;
            splineSeriesView1.Color            = System.Drawing.Color.DodgerBlue;
            splineSeriesView1.LineMarkerOptions.BorderColor   = System.Drawing.Color.DodgerBlue;
            splineSeriesView1.LineMarkerOptions.BorderVisible = false;
            splineSeriesView1.LineMarkerOptions.Kind          = DevExpress.XtraCharts.MarkerKind.Circle;
            splineSeriesView1.LineMarkerOptions.Color         = System.Drawing.Color.DodgerBlue;
            splineSeriesView1.LineMarkerOptions.Size          = 10;

            splineSeriesView1.LineStyle.Thickness = 3;
            series2.LabelsVisibility             = DevExpress.Utils.DefaultBoolean.True;
            series2.Label.ResolveOverlappingMode = ResolveOverlappingMode.JustifyAllAroundPoint;
            //series2.Label.TextPattern = "{V:#,0}";
            series2.View = splineSeriesView1;

            xySeriesUnwindAnimation1.EasingFunction = sineEasingFunction1;
            splineSeriesView1.SeriesAnimation       = xySeriesUnwindAnimation1;

            arg_chart.Legend.Direction = LegendDirection.LeftToRight;

            //Constant line
            //constantLine1.ShowInLegend = false;
            constantLine1.AxisValueSerializable = arg_dt.Rows[0]["TARGET"].ToString();
            constantLine1.Color = System.Drawing.Color.Green;
            constantLine1.Name  = "Target";
            // constantLine1.ShowBehind = false;
            constantLine1.Title.Visible = false;
            constantLine1.Title.Font    = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            //constantLine1.Title.Text = "Target";
            constantLine1.LineStyle.Thickness = 2;
            // constantLine1.Title.Alignment = DevExpress.XtraCharts.ConstantLineTitleAlignment.Far;
            ((XYDiagram)arg_chart.Diagram).AxisY.ConstantLines.Clear();
            ((XYDiagram)arg_chart.Diagram).AxisY.ConstantLines.AddRange(new DevExpress.XtraCharts.ConstantLine[] { constantLine1 });


            //((XYDiagram)arg_chart.Diagram).AxisX.Tickmarks.MinorVisible = false;
            ((XYDiagram)arg_chart.Diagram).AxisX.VisualRange.Auto             = false;
            ((XYDiagram)arg_chart.Diagram).AxisX.VisualRange.AutoSideMargins  = false;
            ((XYDiagram)arg_chart.Diagram).AxisX.VisualRange.SideMarginsValue = 2;
            ((XYDiagram)arg_chart.Diagram).AxisX.Label.Angle = 0;
            ((XYDiagram)arg_chart.Diagram).AxisX.Label.Font  = new System.Drawing.Font("Tahoma", 10, System.Drawing.FontStyle.Bold);
            ((XYDiagram)arg_chart.Diagram).AxisX.NumericScaleOptions.ScaleMode = DevExpress.XtraCharts.ScaleMode.Continuous;
            ((XYDiagram)arg_chart.Diagram).AxisY.Label.Font = new System.Drawing.Font("Tahoma", 10, System.Drawing.FontStyle.Bold);
            ((XYDiagram)arg_chart.Diagram).AxisX.Title.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            ((XYDiagram)arg_chart.Diagram).AxisY.Title.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));

            //--------Text AxisX/ AxisY
            ((XYDiagram)arg_chart.Diagram).AxisY.Title.Text       = "POD";
            ((XYDiagram)arg_chart.Diagram).AxisY.Title.TextColor  = System.Drawing.Color.Orange;
            ((XYDiagram)arg_chart.Diagram).AxisY.Title.Visibility = DevExpress.Utils.DefaultBoolean.Default;
            ((XYDiagram)arg_chart.Diagram).AxisX.Title.Text       = "Date";
            ((XYDiagram)arg_chart.Diagram).AxisX.Title.Visibility = DevExpress.Utils.DefaultBoolean.Default;
            ((XYDiagram)arg_chart.Diagram).AxisX.Title.TextColor  = System.Drawing.Color.Orange;



            //---------------add chart in panel
            pn_body.Controls.Add(arg_chart);
        }
示例#20
0
        private void InitDataChart(string sChart, DataTable dt, DevExpress.XtraCharts.ChartControl chartControl)
        {
            try
            {
                chartControl.Series.Clear();
                //var sTitle = new List<string>();
                //int mLineStart = Convert.ToInt32(line.Equals("VJ2") ? mline : line);
                //if (mLineStart == 3)
                //    mLineStart = 2;
                //else if (mLineStart == 2)
                //    mLineStart = 3;
                //if (!sChart.Equals("UPC"))
                //{
                //    switch (line)
                //    {

                //        case "001":
                //        case "002":
                //        case "003":
                //        case "004":
                //        case "005":
                //        case "006":
                //            for (int i = 1; i <= 3; i++)
                //                sTitle.Add("Stitching " + ((mLineStart - 1) * 3 + i).ToString());
                //            break;
                //        default:
                //            for (int i = 1; i <= 2; i++)
                //                sTitle.Add("Stitching " + ((mLineStart) * 2 + i).ToString());
                //            break;
                //    }
                //}
                string Argname = "";
                DevExpress.XtraCharts.ChartTitle chartTitle = new DevExpress.XtraCharts.ChartTitle();
                switch (sChart)
                {
                case "UPC":
                    Argname = "CUTTING";
                    break;

                case "UPS1":
                    Argname = "STITCHING 1";
                    break;

                case "UPS2":
                    Argname = "STITCHING 2";
                    break;

                case "UPS3":
                    Argname = "STITCHING 3";
                    break;
                }
                Series series1 = new Series("TARGET", ViewType.Line);
                Series series2 = new Series(Argname, ViewType.Bar);


                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    series1.Points.Add(new SeriesPoint(dt.Rows[i]["DAY"].ToString(), string.IsNullOrEmpty(dt.Rows[i][sChart + "_ACT"].ToString()) ? 0.0 : dt.Rows[i][sChart + "_TAR"]));
                    series2.Points.Add(new SeriesPoint(dt.Rows[i]["DAY"].ToString(), string.IsNullOrEmpty(dt.Rows[i][sChart + "_ACT"].ToString()) ? 0.0 : dt.Rows[i][sChart + "_ACT"]));

                    if (Convert.ToDouble(string.IsNullOrEmpty(dt.Rows[i][sChart + "_ACT"].ToString()) ? 0.0 : dt.Rows[i][sChart + "_ACT"]) >= Convert.ToDouble(string.IsNullOrEmpty(dt.Rows[i][sChart + "_TAR"].ToString()) ? 0.0 : dt.Rows[i][sChart + "_TAR"]))
                    {
                        series2.Points[i].Color = Color.Green;
                    }

                    else
                    {
                        series2.Points[i].Color = System.Drawing.Color.Red;
                    }
                }
                series1.LabelsVisibility = DefaultBoolean.True;
                series2.LabelsVisibility = DefaultBoolean.True;
                if (!sChart.Equals("UPC"))
                {
                    //  chartTitle.Text = sTitle[Convert.ToInt32(sChart.Substring(3, 1)) - 1];
                    // chartControl.Titles.Clear();
                    //chartControl.Titles.AddRange(new DevExpress.XtraCharts.ChartTitle[] { chartTitle });
                }
                chartControl.SeriesSerializable = new DevExpress.XtraCharts.Series[] { series1, series2 };
            }
            catch (Exception EX) { }
        }
示例#21
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     DevExpress.XtraCharts.SwiftPlotDiagram         swiftPlotDiagram1         = new DevExpress.XtraCharts.SwiftPlotDiagram();
     DevExpress.XtraCharts.Series                   series1                   = new DevExpress.XtraCharts.Series();
     DevExpress.XtraCharts.SwiftPlotSeriesView      swiftPlotSeriesView1      = new DevExpress.XtraCharts.SwiftPlotSeriesView();
     DevExpress.XtraCharts.SideBySideBarSeriesLabel sideBySideBarSeriesLabel1 = new DevExpress.XtraCharts.SideBySideBarSeriesLabel();
     DevExpress.XtraCharts.ChartTitle               chartTitle1               = new DevExpress.XtraCharts.ChartTitle();
     this.timer1        = new System.Windows.Forms.Timer(this.components);
     this.chartControl1 = new DevExpress.XtraCharts.ChartControl();
     ((System.ComponentModel.ISupportInitialize)(this.chartControl1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(swiftPlotDiagram1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(series1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(swiftPlotSeriesView1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(sideBySideBarSeriesLabel1)).BeginInit();
     this.SuspendLayout();
     //
     // timer1
     //
     this.timer1.Enabled  = true;
     this.timer1.Interval = 10;
     this.timer1.Tick    += new System.EventHandler(this.timer1_Tick);
     //
     // chartControl1
     //
     swiftPlotDiagram1.AxisX.DateTimeScaleOptions.MeasureUnit = DateTimeMeasureUnit.Millisecond;
     swiftPlotDiagram1.AxisX.Label.TextPattern = "{A:mm:ss}";
     swiftPlotDiagram1.AxisX.WholeRange.AlwaysShowZeroLevel = true;
     swiftPlotDiagram1.AxisX.WholeRange.AutoSideMargins     = true;
     swiftPlotDiagram1.AxisX.VisualRange.AutoSideMargins    = true;
     swiftPlotDiagram1.AxisX.VisibleInPanesSerializable     = "-1";
     swiftPlotDiagram1.AxisY.WholeRange.AlwaysShowZeroLevel = true;
     swiftPlotDiagram1.AxisY.WholeRange.AutoSideMargins     = true;
     swiftPlotDiagram1.AxisY.VisualRange.AutoSideMargins    = true;
     swiftPlotDiagram1.AxisY.VisibleInPanesSerializable     = "-1";
     swiftPlotDiagram1.Margins.Left       = 40;
     swiftPlotDiagram1.Margins.Right      = 30;
     this.chartControl1.Diagram           = swiftPlotDiagram1;
     this.chartControl1.Dock              = System.Windows.Forms.DockStyle.Fill;
     this.chartControl1.Legend.Visibility = DevExpress.Utils.DefaultBoolean.False;
     this.chartControl1.Location          = new System.Drawing.Point(0, 0);
     this.chartControl1.Name              = "chartControl1";
     series1.ArgumentScaleType            = DevExpress.XtraCharts.ScaleType.DateTime;
     series1.LegendText = "Swift Plot Series";
     series1.Name       = "series1";
     swiftPlotSeriesView1.Antialiasing = true;
     series1.View = swiftPlotSeriesView1;
     this.chartControl1.SeriesSerializable = new DevExpress.XtraCharts.Series[] {
         series1
     };
     sideBySideBarSeriesLabel1.LineVisibility = DevExpress.Utils.DefaultBoolean.True;
     this.chartControl1.SeriesTemplate.Label  = sideBySideBarSeriesLabel1;
     this.chartControl1.Size     = new System.Drawing.Size(459, 264);
     this.chartControl1.TabIndex = 0;
     chartTitle1.Text            = "The Swift Plot";
     this.chartControl1.Titles.AddRange(new DevExpress.XtraCharts.ChartTitle[] {
         chartTitle1
     });
     //
     // Form1
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
     this.ClientSize          = new System.Drawing.Size(459, 264);
     this.Controls.Add(this.chartControl1);
     this.Name = "Form1";
     this.Text = "Form1";
     ((System.ComponentModel.ISupportInitialize)(swiftPlotDiagram1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(swiftPlotSeriesView1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(series1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(sideBySideBarSeriesLabel1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.chartControl1)).EndInit();
     this.ResumeLayout(false);
 }
示例#22
0
 private void InitializeComponent()
 {
     DevExpress.XtraCharts.ChartTitle chartTitle1 = new DevExpress.XtraCharts.ChartTitle();
     this.layoutControl1      = new DevExpress.XtraLayout.LayoutControl();
     this.chartControl1       = new DevExpress.XtraCharts.ChartControl();
     this.btnStatsOutput      = new DevExpress.XtraEditors.SimpleButton();
     this.comboBoxEdit1       = new DevExpress.XtraEditors.ComboBoxEdit();
     this.layoutControlGroup1 = new DevExpress.XtraLayout.LayoutControlGroup();
     this.layoutControlItem2  = new DevExpress.XtraLayout.LayoutControlItem();
     this.emptySpaceItem5     = new DevExpress.XtraLayout.EmptySpaceItem();
     this.layoutControlItem4  = new DevExpress.XtraLayout.LayoutControlItem();
     this.layoutControlItem3  = new DevExpress.XtraLayout.LayoutControlItem();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
     this.layoutControl1.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.chartControl1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.comboBoxEdit1.Properties)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem5)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).BeginInit();
     this.SuspendLayout();
     //
     // layoutControl1
     //
     this.layoutControl1.Controls.Add(this.chartControl1);
     this.layoutControl1.Controls.Add(this.btnStatsOutput);
     this.layoutControl1.Controls.Add(this.comboBoxEdit1);
     this.layoutControl1.Dock     = System.Windows.Forms.DockStyle.Fill;
     this.layoutControl1.Location = new System.Drawing.Point(0, 0);
     this.layoutControl1.Name     = "layoutControl1";
     this.layoutControl1.OptionsCustomizationForm.DesignTimeCustomizationFormPositionAndSize = new System.Drawing.Rectangle(895, 161, 250, 350);
     this.layoutControl1.Root     = this.layoutControlGroup1;
     this.layoutControl1.Size     = new System.Drawing.Size(723, 445);
     this.layoutControl1.TabIndex = 0;
     this.layoutControl1.Text     = "layoutControl1";
     //
     // chartControl1
     //
     this.chartControl1.Location           = new System.Drawing.Point(2, 28);
     this.chartControl1.Name               = "chartControl1";
     this.chartControl1.SeriesSerializable = new DevExpress.XtraCharts.Series[0];
     this.chartControl1.Size               = new System.Drawing.Size(719, 415);
     this.chartControl1.TabIndex           = 3;
     this.chartControl1.Titles.AddRange(new DevExpress.XtraCharts.ChartTitle[] {
         chartTitle1
     });
     //
     // btnStatsOutput
     //
     this.btnStatsOutput.Location        = new System.Drawing.Point(544, 2);
     this.btnStatsOutput.Name            = "btnStatsOutput";
     this.btnStatsOutput.Size            = new System.Drawing.Size(177, 22);
     this.btnStatsOutput.StyleController = this.layoutControl1;
     this.btnStatsOutput.TabIndex        = 3;
     this.btnStatsOutput.Text            = "输出统计图";
     this.btnStatsOutput.Click          += new System.EventHandler(this.btnStatsOutput_Click);
     //
     // comboBoxEdit1
     //
     this.comboBoxEdit1.EditValue = "柱状图";
     this.comboBoxEdit1.Location  = new System.Drawing.Point(77, 2);
     this.comboBoxEdit1.Name      = "comboBoxEdit1";
     this.comboBoxEdit1.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
         new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)
     });
     this.comboBoxEdit1.Properties.Items.AddRange(new object[] {
         "柱状图",
         "饼状图",
         "线状图",
         "3D柱状图",
         "3D线状图"
     });
     this.comboBoxEdit1.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor;
     this.comboBoxEdit1.Size                  = new System.Drawing.Size(282, 22);
     this.comboBoxEdit1.StyleController       = this.layoutControl1;
     this.comboBoxEdit1.TabIndex              = 1;
     this.comboBoxEdit1.SelectedIndexChanged += new System.EventHandler(this.comboBoxEdit1_SelectedIndexChanged);
     //
     // layoutControlGroup1
     //
     this.layoutControlGroup1.CustomizationFormText       = "Root";
     this.layoutControlGroup1.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True;
     this.layoutControlGroup1.GroupBordersVisible         = false;
     this.layoutControlGroup1.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
         this.layoutControlItem2,
         this.emptySpaceItem5,
         this.layoutControlItem4,
         this.layoutControlItem3
     });
     this.layoutControlGroup1.Location    = new System.Drawing.Point(0, 0);
     this.layoutControlGroup1.Name        = "Root";
     this.layoutControlGroup1.Padding     = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0);
     this.layoutControlGroup1.Size        = new System.Drawing.Size(723, 445);
     this.layoutControlGroup1.Text        = "Root";
     this.layoutControlGroup1.TextVisible = false;
     //
     // layoutControlItem2
     //
     this.layoutControlItem2.Control = this.comboBoxEdit1;
     this.layoutControlItem2.CustomizationFormText = "layoutControlItem2";
     this.layoutControlItem2.Location = new System.Drawing.Point(0, 0);
     this.layoutControlItem2.Name     = "layoutControlItem2";
     this.layoutControlItem2.Size     = new System.Drawing.Size(361, 26);
     this.layoutControlItem2.Text     = "统计图样式:";
     this.layoutControlItem2.TextSize = new System.Drawing.Size(72, 14);
     //
     // emptySpaceItem5
     //
     this.emptySpaceItem5.AllowHotTrack         = false;
     this.emptySpaceItem5.CustomizationFormText = "emptySpaceItem5";
     this.emptySpaceItem5.Location = new System.Drawing.Point(361, 0);
     this.emptySpaceItem5.Name     = "emptySpaceItem5";
     this.emptySpaceItem5.Size     = new System.Drawing.Size(181, 26);
     this.emptySpaceItem5.Text     = "emptySpaceItem5";
     this.emptySpaceItem5.TextSize = new System.Drawing.Size(0, 0);
     //
     // layoutControlItem4
     //
     this.layoutControlItem4.Control = this.btnStatsOutput;
     this.layoutControlItem4.CustomizationFormText = "layoutControlItem4";
     this.layoutControlItem4.Location = new System.Drawing.Point(542, 0);
     this.layoutControlItem4.Name     = "layoutControlItem4";
     this.layoutControlItem4.Size     = new System.Drawing.Size(181, 26);
     this.layoutControlItem4.Text     = "layoutControlItem4";
     this.layoutControlItem4.TextSize = new System.Drawing.Size(0, 0);
     this.layoutControlItem4.TextToControlDistance = 0;
     this.layoutControlItem4.TextVisible           = false;
     //
     // layoutControlItem3
     //
     this.layoutControlItem3.Control = this.chartControl1;
     this.layoutControlItem3.CustomizationFormText = "layoutControlItem3";
     this.layoutControlItem3.Location = new System.Drawing.Point(0, 26);
     this.layoutControlItem3.Name     = "layoutControlItem3";
     this.layoutControlItem3.Size     = new System.Drawing.Size(723, 419);
     this.layoutControlItem3.Text     = "layoutControlItem3";
     this.layoutControlItem3.TextSize = new System.Drawing.Size(0, 0);
     this.layoutControlItem3.TextToControlDistance = 0;
     this.layoutControlItem3.TextVisible           = false;
     //
     // FrmPipeStatsChart
     //
     this.ClientSize = new System.Drawing.Size(723, 445);
     this.Controls.Add(this.layoutControl1);
     this.MinimizeBox   = false;
     this.Name          = "FrmPipeStatsChart";
     this.ShowIcon      = false;
     this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
     this.Text          = "管线长度统计图表";
     ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).EndInit();
     this.layoutControl1.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(this.chartControl1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.comboBoxEdit1.Properties)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem5)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).EndInit();
     this.ResumeLayout(false);
 }