Example #1
0
        //Chart Component Shortage Yesterday
        private void BindingChart5(DataSet dt)
        {
            try
            {
                lblTotalTodaySet.Text = "0 Prs"; lblTotalTodayDeli.Text = "0 Prs";
                if (dt != null && dt.Tables[0].Rows.Count > 0)
                {
                    lblTotalTodaySet.Text  = string.Format("{0:n0}", dt.Tables[3].Rows[0]["TOT_SET"]) + " Prs";
                    lblTotalTodayDeli.Text = string.Format("{0:n0}", dt.Tables[3].Rows[0]["TOT_UP"]) + " Prs";
                    DevExpress.XtraCharts.ConstantLine constantLine1 = new DevExpress.XtraCharts.ConstantLine();
                    chartControl2.DataSource = dt.Tables[3];
                    chartControl2.Series[0].ArgumentDataMember = "TRIP";
                    chartControl2.Series[0].ValueDataMembers.AddRange(new string[] { "RATE_UP_SET" });

                    //==================
                    constantLine1.AxisValueSerializable = "10";
                    constantLine1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(146)))), ((int)(((byte)(208)))), ((int)(((byte)(80)))));
                    constantLine1.LineStyle.Thickness = 3;
                    constantLine1.Name            = "Average";
                    constantLine1.Title.Alignment = DevExpress.XtraCharts.ConstantLineTitleAlignment.Far;
                    constantLine1.Title.Font      = new System.Drawing.Font("Calibri", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                    constantLine1.AxisValue       = dt.Tables[3].Rows[0]["TOT_UP"].ToString() != "0" ? (Convert.ToDouble(dt.Tables[3].Rows[0]["TOT_SET"]) / Convert.ToDouble(dt.Tables[3].Rows[0]["TOT_UP"]) * 100).ToString() : "0";
                    ((XYDiagram)chartControl2.Diagram).AxisY.ConstantLines.Clear();
                    ((XYDiagram)chartControl2.Diagram).AxisY.ConstantLines.AddRange(new DevExpress.XtraCharts.ConstantLine[] { constantLine1 });
                    //==================

                    //chartControl2.Series[1].ArgumentDataMember = "TRIP";
                    //chartControl2.Series[1].ValueDataMembers.AddRange(new string[] { "RATIO_TOT_UP" });
                    chartControl3.DataSource = dt.Tables[3];
                    chartControl3.Series[0].ArgumentDataMember = "TRIP";
                    chartControl3.Series[0].ValueDataMembers.AddRange(new string[] { "UP" });
                    chartControl3.Series[1].ArgumentDataMember = "TRIP";
                    chartControl3.Series[1].ValueDataMembers.AddRange(new string[] { "SET" });
                    chartControl3.Series[2].ArgumentDataMember = "TRIP";
                    chartControl3.Series[2].ValueDataMembers.AddRange(new string[] { "RATE_UP_SET" });

                    //chartControl3.SeriesDataMember = "CMP_CD";
                    //chartControl3.SeriesTemplate.ArgumentDataMember = "TRIP";
                    //chartControl3.SeriesTemplate.ValueDataMembers.AddRange(new string[] { "QTY" });
                    //chartControl3.SeriesTemplate.Label.TextPattern = "{V:#,#}";
                    //chartControl1.SeriesTemplate.ChangeView(DevExpress.XtraCharts.ViewType.Spline);
                    //chartControl1.SeriesTemplate.LabelsVisibility = DevExpress.Utils.DefaultBoolean.True;
                }
            }
            catch  { }
        }
Example #2
0
        private void bindingchart(DataTable dtchart, string col, ChartControl chart_tmp, string title, string flag, DataTable dt1, DataTable dt2)
        {
            try
            {
                string col_min = "", col_max = "";
                double min = 0, max = 0, _min = 0, _max = 0;
                switch (flag)
                {
                case "ISO":
                    col_min = "ISO_MIN";
                    col_max = "ISO_MAX";
                    break;

                case "OIL":
                    col_min = "OIL_MIN";
                    col_max = "OIL_MAX";
                    break;

                case "POLY":
                    col_min = "POLY_MIN";
                    col_max = "POLY_MAX";
                    break;
                }

                if (dtchart != null)
                {
                    DataTable dtmin = dtchart.Select("", col + " ASC").CopyToDataTable();
                    _min = Convert.ToDouble(dt2.Rows[0]["STAND_" + col.Substring(4, 2)]) - Convert.ToDouble(dt2.Rows[0]["SPEC_" + col.Substring(4, 2)]);
                    _max = Convert.ToDouble(dt2.Rows[0]["STAND_" + col.Substring(4, 2)]) + Convert.ToDouble(dt2.Rows[0]["SPEC_" + col.Substring(4, 2)]);
                    if (_min > Convert.ToDouble(dtmin.Rows[0][col]) && Convert.ToDouble(dtmin.Rows[0][col]) > 0)
                    {
                        min = Convert.ToDouble(dtmin.Rows[0][col]);
                    }
                    else
                    {
                        min = _min;
                    }

                    DataTable dtmax = dtchart.Select("", col + " DESC").CopyToDataTable();
                    if (_max < Convert.ToDouble(dtmax.Rows[0][col]) && Convert.ToDouble(dtmax.Rows[0][col]) > 0)
                    {
                        max = Convert.ToDouble(dtmax.Rows[0][col]);
                    }
                    else
                    {
                        max = _max;
                    }
                }

                chart_tmp.Titles.Clear();
                chart_tmp.Titles.Add(new ChartTitle());
                DevExpress.XtraCharts.ConstantLine constantLine1 = new DevExpress.XtraCharts.ConstantLine();
                DevExpress.XtraCharts.ConstantLine constantLine2 = new DevExpress.XtraCharts.ConstantLine();
                if (dtchart != null && dtchart.Rows.Count > 0)
                {
                    constantLine1.AxisValueSerializable = _min.ToString();
                    constantLine1.Color = System.Drawing.Color.Red;
                    constantLine1.LineStyle.Thickness = 4;
                    constantLine1.LineStyle.DashStyle = DashStyle.Solid;
                    constantLine1.Name         = "";
                    constantLine1.ShowInLegend = false;

                    constantLine2.AxisValueSerializable = _max.ToString();
                    constantLine2.Color = System.Drawing.Color.Red;
                    constantLine2.LineStyle.Thickness = 4;
                    constantLine2.LineStyle.DashStyle = DashStyle.Solid;
                    constantLine2.Name         = "";
                    constantLine2.ShowInLegend = false;

                    ((XYDiagram)chart_tmp.Diagram).AxisY.ConstantLines.Clear();
                    ((XYDiagram)chart_tmp.Diagram).AxisY.ConstantLines.AddRange(new DevExpress.XtraCharts.ConstantLine[] { constantLine1, constantLine2 });
                }
                chart_tmp.DataSource = dtchart;
                //chart_tmp.Series[0].ArgumentDataMember = "HMS";
                //chart_tmp.Series[0].ValueDataMembers.AddRange(new string[] { col_max });
                //chart_tmp.Series[1].ArgumentDataMember = "HMS";
                //chart_tmp.Series[1].ValueDataMembers.AddRange(new string[] { col_min });
                chart_tmp.Series[2].ArgumentDataMember = "HMS";
                chart_tmp.Series[2].ValueDataMembers.AddRange(new string[] { col });
                chart_tmp.Series[2].View.Color = Color.DodgerBlue;
                chart_tmp.Titles[0].Text       = title + " °C";
                chart_tmp.Titles[0].Visibility = DevExpress.Utils.DefaultBoolean.True;
                chart_tmp.Titles[0].Font       = new System.Drawing.Font("Calibri", 12, FontStyle.Bold);
                chart_tmp.Titles[0].Indent     = 0;
                chart_tmp.Titles[0].TextColor  = Color.HotPink;

                ((XYDiagram)chart_tmp.Diagram).AxisY.WholeRange.Auto = true;
                ((XYDiagram)chart_tmp.Diagram).AxisY.WholeRange.SetMinMaxValues(min, max);
                //((XYDiagram)chart_tmp.Diagram).AxisY.WholeRange.SetMinMaxValues(Convert.ToDouble(dtchart.Rows[0][col_min]), Convert.ToDouble(dtchart.Rows[0][col_max]));
            }
            catch
            {
            }
        }
Example #3
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);
        }
Example #4
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);
        }
        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 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
            {
            }
        }
Example #7
0
        private void bindingchart(DataTable dtchart, string col, ChartControl chart_tmp, string title)
        {
            try
            {
                string col_min = "", col_max = "";
                double min = 0, max = 0;
                if (dtchart != null)
                {
                    col_min = "V_MIN";
                    col_max = "V_MAX";
                    DataTable dtmin = dtchart.Select("", col + " ASC").CopyToDataTable();
                    if (Convert.ToDouble(dtchart.Rows[0][col_min]) > Convert.ToDouble(dtmin.Rows[0][col] == null ? "0" : dtmin.Rows[0][col]) && Convert.ToDouble(dtmin.Rows[0][col] == null ? "0" : dtmin.Rows[0][col]) > 0)
                    {
                        min = Convert.ToDouble(dtmin.Rows[0][col]);
                    }
                    else
                    {
                        min = Convert.ToDouble(dtchart.Rows[0][col_min]);
                    }

                    DataTable dtmax = dtchart.Select("", col + " DESC").CopyToDataTable();
                    if (Convert.ToDouble(dtchart.Rows[0][col_max]) < Convert.ToDouble(dtmax.Rows[0][col] == null ? "0" : dtmax.Rows[0][col]) && Convert.ToDouble(dtmax.Rows[0][col] == null ? "0" : dtmax.Rows[0][col]) > 0)
                    {
                        max = Convert.ToDouble(dtmax.Rows[0][col]);
                    }
                    else
                    {
                        max = Convert.ToDouble(dtchart.Rows[0][col_max]);
                    }
                }
                chart_tmp.Titles.Clear();
                chart_tmp.Titles.Add(new ChartTitle());
                DevExpress.XtraCharts.ConstantLine constantLine1 = new DevExpress.XtraCharts.ConstantLine();
                DevExpress.XtraCharts.ConstantLine constantLine2 = new DevExpress.XtraCharts.ConstantLine();

                if (dtchart.Rows.Count > 0)
                {
                    constantLine1.AxisValueSerializable = dtchart.Rows[0][col_min].ToString();
                    constantLine1.Color = System.Drawing.Color.Red;
                    constantLine1.LineStyle.Thickness = 4;
                    constantLine1.LineStyle.DashStyle = DashStyle.Solid;
                    constantLine1.Name         = "";
                    constantLine1.ShowInLegend = false;

                    constantLine2.AxisValueSerializable = dtchart.Rows[0][col_max].ToString();
                    constantLine2.Color = System.Drawing.Color.Red;
                    constantLine2.LineStyle.Thickness = 4;
                    constantLine2.LineStyle.DashStyle = DashStyle.Solid;
                    constantLine2.Name         = "";
                    constantLine2.ShowInLegend = false;

                    ((XYDiagram)chart_tmp.Diagram).AxisY.ConstantLines.Clear();
                    ((XYDiagram)chart_tmp.Diagram).AxisY.ConstantLines.AddRange(new DevExpress.XtraCharts.ConstantLine[] { constantLine1, constantLine2 });
                }

                chart_tmp.DataSource = dtchart;
                //chart_tmp.Series[0].ArgumentDataMember = "HMS";
                //chart_tmp.Series[0].ValueDataMembers.AddRange(new string[] { col_max });
                //chart_tmp.Series[1].ArgumentDataMember = "HMS";
                //chart_tmp.Series[1].ValueDataMembers.AddRange(new string[] { col_min });
                chart_tmp.Series[2].ArgumentDataMember = "HMS";
                chart_tmp.Series[2].ValueDataMembers.AddRange(new string[] { col });
                chart_tmp.Series[2].View.Color = Color.DodgerBlue;
                chart_tmp.Titles[0].Text       = title + " temperature °C";
                chart_tmp.Titles[0].Visibility = DevExpress.Utils.DefaultBoolean.True;
                chart_tmp.Titles[0].Font       = new System.Drawing.Font("Calibri", 16, FontStyle.Bold);
                chart_tmp.Titles[0].Indent     = 0;
                chart_tmp.Titles[0].TextColor  = Color.HotPink;
                ((XYDiagram)chart_tmp.Diagram).AxisY.WholeRange.Auto = true;
                ((XYDiagram)chart_tmp.Diagram).AxisY.WholeRange.SetMinMaxValues(min, max);
                //((XYDiagram)chart_tmp.Diagram).AxisY.WholeRange.SetMinMaxValues(Convert.ToDouble(dtchart.Rows[0][col_min]), Convert.ToDouble(dtchart.Rows[0][col_max]));
            }
            catch
            {
                chart_tmp.Titles.Clear();
                chart_tmp.Titles.Add(new ChartTitle());
                chart_tmp.DataSource           = dtchart;
                chart_tmp.Titles[0].Text       = title + " temperature °C";
                chart_tmp.Titles[0].Visibility = DevExpress.Utils.DefaultBoolean.True;
                chart_tmp.Titles[0].Font       = new System.Drawing.Font("Calibri", 16, FontStyle.Bold);
                chart_tmp.Titles[0].Indent     = 0;
                chart_tmp.Titles[0].TextColor  = Color.HotPink;
            }
        }