示例#1
0
        private void CreateChart()
        {
            try
            {
                chartBTS.Legends.Clear();
                //chartBTS.AppearanceNameSerializable = "Chameleon";
                Series series1 = new Series("BTS", ViewType.Bar);
                chartBTS.AnimationStartMode = DevExpress.XtraCharts.ChartAnimationMode.OnDataChanged;
                DevExpress.XtraCharts.SideBySideBarSeriesView  sideBySideBarSeriesView1  = new DevExpress.XtraCharts.SideBySideBarSeriesView();
                DevExpress.XtraCharts.SideBySideBarSeriesLabel sideBySideBarSeriesLabel1 = new DevExpress.XtraCharts.SideBySideBarSeriesLabel();

                Series series2 = new Series("Target", ViewType.Line);
                DevExpress.XtraCharts.LineSeriesView lineSeriesView1 = new DevExpress.XtraCharts.LineSeriesView();

                lineSeriesView1.MarkerVisibility            = DevExpress.Utils.DefaultBoolean.False;
                sideBySideBarSeriesView1.ColorEach          = false;
                sideBySideBarSeriesView1.Color              = System.Drawing.Color.LimeGreen;
                sideBySideBarSeriesView1.FillStyle.FillMode = DevExpress.XtraCharts.FillMode.Solid;
                series1.Label.Font        = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                series1.Label.BackColor   = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
                series1.Label.TextPattern = "{V:#,#.0}" + "%";
                series1.View             = sideBySideBarSeriesView1;
                series1.LabelsVisibility = DevExpress.Utils.DefaultBoolean.True;

                series2.Label.Font        = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                series2.LabelsVisibility  = DevExpress.Utils.DefaultBoolean.False;
                series2.Label.TextPattern = "{V:#,#.0}" + "%";
                lineSeriesView1.Color     = System.Drawing.Color.LimeGreen;
                lineSeriesView1.LineMarkerOptions.Color = System.Drawing.Color.FromArgb(((int)(((byte)(146)))), ((int)(((byte)(208)))), ((int)(((byte)(80)))));
                lineSeriesView1.LineStyle.Thickness     = 4;
                series2.View = lineSeriesView1;

                DataTable dt = SEL_SMT_BTS("C", line, mline, opcd, UC_MONTH.GetValue());

                if (dt != null && dt.Rows.Count > 0)
                {
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        series1.Points.Add(new SeriesPoint(dt.Rows[i]["DAY"].ToString(), dt.Rows[i]["BTS"]));
                        series2.Points.Add(new SeriesPoint(dt.Rows[i]["DAY"].ToString(), dt.Rows[i]["TARGET"]));

                        if (Convert.ToDouble(dt.Rows[i]["BTS"]) < Convert.ToDouble(dt.Rows[i]["TARGET"]) && Convert.ToDouble(dt.Rows[i]["BTS"]) >= Convert.ToDouble(dt.Rows[i]["TARGET"]) - 5)
                        {
                            series1.Points[i].Color = Color.Yellow;
                        }
                        else if (Convert.ToDouble(dt.Rows[i]["BTS"]) < Convert.ToDouble(dt.Rows[i]["TARGET"]) - 5)
                        {
                            series1.Points[i].Color = Color.Red;
                        }
                        else
                        {
                            series1.Points[i].Color = System.Drawing.Color.LimeGreen;
                        }
                    }

                    chartBTS.SeriesSerializable = new DevExpress.XtraCharts.Series[] { series1, series2 };

                    ((XYDiagram)chartBTS.Diagram).AxisX.Label.Font        = new System.Drawing.Font("Tahoma", 13F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                    ((XYDiagram)chartBTS.Diagram).AxisX.Title.TextColor   = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));
                    ((XYDiagram)chartBTS.Diagram).AxisY.Label.TextPattern = "{V:#,#}";
                    ((XYDiagram)chartBTS.Diagram).AxisY.Label.Font        = new System.Drawing.Font("Tahoma", 13F);
                    ((XYDiagram)chartBTS.Diagram).AxisY.Title.Font        = new System.Drawing.Font("Calibri", 22F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                    ((XYDiagram)chartBTS.Diagram).AxisY.Title.Text        = "BTS (%)";
                    ((XYDiagram)chartBTS.Diagram).AxisY.Title.TextColor   = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));

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

                    customLegendItem1.MarkerColor = System.Drawing.Color.LimeGreen;
                    customLegendItem1.Name        = "GREEN";
                    customLegendItem1.Text        = ">=" + dt.Rows[0]["TARGET"].ToString() + "%";
                    customLegendItem2.MarkerColor = System.Drawing.Color.Yellow;
                    customLegendItem2.Name        = "YELLOW";
                    customLegendItem2.Text        = ">=" + (Convert.ToDouble(dt.Rows[0]["TARGET"].ToString()) - 5).ToString() + "% and <" + dt.Rows[0]["TARGET"].ToString() + "%";
                    customLegendItem3.MarkerColor = System.Drawing.Color.Red;
                    customLegendItem3.Name        = "RED";
                    customLegendItem3.Text        = "<" + (Convert.ToDouble(dt.Rows[0]["TARGET"].ToString()) - 5).ToString() + "%";

                    legend1.CustomItems.AddRange(new DevExpress.XtraCharts.CustomLegendItem[] {
                        customLegendItem1,
                        customLegendItem2,
                        customLegendItem3
                    });
                    legend1.AlignmentHorizontal = DevExpress.XtraCharts.LegendAlignmentHorizontal.Right;
                    legend1.AlignmentVertical   = DevExpress.XtraCharts.LegendAlignmentVertical.TopOutside;
                    legend1.Direction           = DevExpress.XtraCharts.LegendDirection.LeftToRight;
                    legend1.Font = new System.Drawing.Font("Tahoma", 12F);
                    legend1.Name = "Legend1";
                    this.chartBTS.Legends.AddRange(new DevExpress.XtraCharts.Legend[] { legend1 });
                }
            }
            catch (Exception EX)
            {
            }
        }
        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);
        }
        private void BindingPOD(DataTable arg_dt)
        {
            arcScaleTrucks.EnableAnimation = false;
            arcScaleTrucks.EasingMode      = DevExpress.XtraGauges.Core.Model.EasingMode.EaseIn;
            arcScaleTrucks.EasingFunction  = new BackEase();
            //  arcScaleTrucks.MinValue = 0;
            // arcScaleTrucks.MaxValue = 20;
            //arcScaleTrucks.Ranges[0].EndValue = arcScaleTrucks.Ranges[1].StartValue = Convert.ToSingle(10);
            //arcScaleTrucks.Ranges[1].EndValue = arcScaleTrucks.Ranges[2].StartValue = Convert.ToSingle(15);
            //arcScaleTrucks.Ranges[2].EndValue = Convert.ToSingle(20);
            arcScaleTrucks.Value = 0;
            // lblGaugesValue.Text = "0";
            if (arg_dt != null && arg_dt.Rows.Count > 0)
            {
                try
                {
                    DevExpress.XtraCharts.CustomLegendItem customLegendItem1 = new DevExpress.XtraCharts.CustomLegendItem();
                    DevExpress.XtraCharts.CustomLegendItem customLegendItem2 = new DevExpress.XtraCharts.CustomLegendItem();
                    DevExpress.XtraCharts.CustomLegendItem customLegendItem3 = new DevExpress.XtraCharts.CustomLegendItem();

                    arcScaleTrucks.MinValue = Convert.ToSingle(arg_dt.Rows[0]["MIN_VALUE"]);
                    arcScaleTrucks.MaxValue = Convert.ToSingle(arg_dt.Rows[0]["MAX_VALUE"]);
                    //arcScaleTrucks.Ranges[0].StartValue = Convert.ToSingle(arg_dt.Rows[0]["MIN_VALUE"]);
                    //arcScaleTrucks.Ranges[0].EndValue = arcScaleTrucks.Ranges[1].StartValue = Convert.ToSingle(arg_dt.Rows[0]["YELLOW_VALUE"]); ;
                    //arcScaleTrucks.Ranges[1].EndValue = arcScaleTrucks.Ranges[2].StartValue = Convert.ToSingle(arg_dt.Rows[0]["GREEN_VALUE"]); ;
                    //arcScaleTrucks.Ranges[2].EndValue = Convert.ToSingle(arg_dt.Rows[0]["MAX_VALUE"]);
                    // arcScaleTrucks.Ranges[0].AppearanceRange.Content

                    arcScaleTrucks.Ranges[0].StartValue = Convert.ToSingle(arg_dt.Rows[0]["MIN_VALUE"]);
                    arcScaleTrucks.Ranges[0].EndValue   = arcScaleTrucks.Ranges[1].StartValue = Convert.ToSingle(arg_dt.Rows[0]["YELLOW_VALUE"]);;
                    arcScaleTrucks.Ranges[1].EndValue   = arcScaleTrucks.Ranges[2].StartValue = Convert.ToSingle(arg_dt.Rows[0]["GREEN_VALUE"]);;
                    arcScaleTrucks.Ranges[2].EndValue   = Convert.ToSingle(arg_dt.Rows[0]["MAX_VALUE"]);

                    arcScaleTrucks.EnableAnimation = true;
                    arcScaleTrucks.EasingMode      = DevExpress.XtraGauges.Core.Model.EasingMode.EaseInOut;
                    arcScaleTrucks.EasingFunction  = new BackEase();
                    double num = Convert.ToDouble(arg_dt.Rows[0]["POD"]); //GetRandomNumber(20, 90);
                    arcScaleTrucks.Value = (float)num;
                    //if (num < Convert.ToDouble(arg_dt.Rows[0]["YELLOW_VALUE"]))
                    //{
                    //    lblGaugesValue.ForeColor = Color.Red;
                    //}
                    //else if (num >= Convert.ToDouble(arg_dt.Rows[0]["YELLOW_VALUE"]) && num < Convert.ToDouble(arg_dt.Rows[0]["GREEN_VALUE"]))
                    //{
                    //    lblGaugesValue.ForeColor = Color.Yellow;
                    //}
                    //else if (num >= Convert.ToDouble(arg_dt.Rows[0]["GREEN_VALUE"]))
                    //{
                    //    lblGaugesValue.ForeColor = Color.Green;
                    //}



                    lblGaugesValue.Text = arg_dt.Rows[0]["POD"].ToString();
                    // lbl_POD.Text = arg_dt.Rows[0]["TITLE"].ToString();

                    lblRed.Text    = "<" + arg_dt.Rows[0]["YELLOW_VALUE"].ToString();
                    lblYellow.Text = arg_dt.Rows[0]["YELLOW_VALUE"].ToString() + " ~ " + arg_dt.Rows[0]["GREEN_VALUE"].ToString();
                    lblGreen.Text  = ">" + arg_dt.Rows[0]["GREEN_VALUE"].ToString();
                }
                catch
                { }
            }
        }
        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
            {
            }
        }