Пример #1
0
        private void AddRange(DevExpress.XtraGauges.Win.Gauges.Circular.ArcScaleComponent arcScaleComponent, string startValue, string strRedValue, string strYellowValue, string strGreenValue)
        {
            DevExpress.XtraGauges.Core.Model.ArcScaleRange arcScaleRangeRed    = new DevExpress.XtraGauges.Core.Model.ArcScaleRange();
            DevExpress.XtraGauges.Core.Model.ArcScaleRange arcScaleRangeYellow = new DevExpress.XtraGauges.Core.Model.ArcScaleRange();
            DevExpress.XtraGauges.Core.Model.ArcScaleRange arcScaleRangeGreen  = new DevExpress.XtraGauges.Core.Model.ArcScaleRange();
            arcScaleComponent.Ranges.Clear();
            arcScaleRangeRed.StartThickness = 18;
            arcScaleRangeRed.EndThickness   = 18;
            arcScaleRangeRed.Name           = "Range0";
            arcScaleRangeRed.ShapeOffset    = -10F;
            arcScaleRangeRed.EndValue       = Convert.ToSingle(strRedValue);
            arcScaleRangeRed.AppearanceRange.ContentBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:Red");

            arcScaleRangeYellow.StartThickness = 18;
            arcScaleRangeYellow.EndThickness   = 18;
            arcScaleRangeYellow.Name           = "Range1";
            arcScaleRangeYellow.ShapeOffset    = -10F;
            arcScaleRangeYellow.StartValue     = Convert.ToSingle(strRedValue);
            arcScaleRangeYellow.EndValue       = Convert.ToSingle(strYellowValue);
            arcScaleRangeYellow.AppearanceRange.ContentBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:Yellow");

            arcScaleRangeGreen.StartThickness = 18;
            arcScaleRangeGreen.EndThickness   = 18;
            arcScaleRangeGreen.Name           = "Range2";
            arcScaleRangeGreen.ShapeOffset    = -10F;
            arcScaleRangeGreen.StartValue     = Convert.ToSingle(strYellowValue);
            arcScaleRangeGreen.EndValue       = Convert.ToSingle(strGreenValue);
            arcScaleRangeGreen.AppearanceRange.ContentBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:Green");

            arcScaleComponent.Ranges.AddRange(new DevExpress.XtraGauges.Core.Model.IRange[] { arcScaleRangeRed, arcScaleRangeYellow, arcScaleRangeGreen });
        }
Пример #2
0
        public void BindingData(DataTable dt)
        {
            try
            {
                //chartOSD.DataSource = dt.Select("DIV <> 'RATE'").CopyToDataTable();
                //chartOSD.Series[0].ArgumentDataMember = "DIV";
                //chartOSD.Series[0].ValueDataMembers.AddRange(new string[] { "VALUE" });

                //lblProductionQty.Text = Convert.ToDouble(dt.Rows[0]["VALUE"]).ToString("#,0") + " Prs";
                //lblOSDQty.Text = Convert.ToDouble(dt.Rows[1]["VALUE"]).ToString("#,0") + " Prs";
                //lblRatePercent.Text = Convert.ToDouble(dt.Rows[2]["VALUE"]).ToString("0.0#") + "%";
                arcScale_VAL.EnableAnimation = false;
                //arcScale_VAL.EasingMode = EasingMode.EaseInOut;
                //arcScale_VAL.EasingFunction = new ElasticEase();
                arcScale_VAL.Value           = 0;
                arcScale_VAL.EnableAnimation = true;
                arcScale_VAL.EasingMode      = EasingMode.EaseInOut;
                arcScale_VAL.EasingFunction  = new BackEase();
                arcScale_VAL.Ranges.Clear();
                DevExpress.XtraGauges.Core.Model.ArcScaleRange arcScaleRange = new DevExpress.XtraGauges.Core.Model.ArcScaleRange();
                if (dt.Rows.Count > 0)
                {
                    lblProd.Text       = Convert.ToDouble(dt.Rows[0][1].ToString()).ToString("#,#") + " Prs";
                    lblOSD.Text        = Convert.ToDouble(dt.Rows[1][1].ToString()).ToString("#,#") + " Prs";
                    arcScale_VAL.Value = Convert.ToSingle(dt.Rows[2][1].ToString());
                    lbl_Scale.Text     = dt.Rows[2][1].ToString() + "%";
                    //if (Convert.ToSingle(dt.Rows[2][1].ToString()) < 0.43)
                    if (Convert.ToSingle(dt.Rows[2][1].ToString()) <= 1)
                    {
                        arcScaleRange.AppearanceRange.ContentBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:Green");
                        arcScaleRange.EndValue    = Convert.ToSingle(dt.Rows[2][1].ToString());
                        arcScaleRange.Name        = "Range0";
                        arcScaleRange.ShapeOffset = 29F;
                        this.arcScale_VAL.Ranges.AddRange(new DevExpress.XtraGauges.Core.Model.IRange[] { arcScaleRange });
                        lbl_Scale.AppearanceText.TextBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:Green");
                    }
                    else
                    {
                        arcScaleRange.AppearanceRange.ContentBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:Red");
                        arcScaleRange.EndValue    = Convert.ToSingle(dt.Rows[2][1].ToString());
                        arcScaleRange.Name        = "Range0";
                        arcScaleRange.ShapeOffset = 29F;
                        this.arcScale_VAL.Ranges.AddRange(new DevExpress.XtraGauges.Core.Model.IRange[] { arcScaleRange });
                        lbl_Scale.AppearanceText.TextBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:Red");
                    }
                }
            }
            catch { }
        }
Пример #3
0
        private void chartPOD(DevExpress.XtraGauges.Win.Gauges.Circular.ArcScaleComponent arcScaleComponent
                              , DevExpress.XtraGauges.Win.Base.LabelComponent arglbl
                              , string argPer, string argYellow, string argGreen, string argMax)
        {
            try
            {
                //Chart Per
                DevExpress.XtraGauges.Core.Model.ArcScaleRange arcScaleRangeRed    = new DevExpress.XtraGauges.Core.Model.ArcScaleRange();
                DevExpress.XtraGauges.Core.Model.ArcScaleRange arcScaleRangeYellow = new DevExpress.XtraGauges.Core.Model.ArcScaleRange();
                DevExpress.XtraGauges.Core.Model.ArcScaleRange arcScaleRangeGreen  = new DevExpress.XtraGauges.Core.Model.ArcScaleRange();

                float  fValue      = Convert.ToSingle(argPer);
                float  fMaxValue   = Convert.ToSingle(argMax);
                string strMaxValue = argMax;
                arcScaleComponent.EnableAnimation = false;
                arcScaleComponent.EasingMode      = DevExpress.XtraGauges.Core.Model.EasingMode.EaseInOut;
                arcScaleComponent.EasingFunction  = new BackEase();
                arglbl.Text             = "0";
                arcScaleComponent.Value = 0;

                arcScaleComponent.EnableAnimation = true;
                arcScaleComponent.EasingMode      = DevExpress.XtraGauges.Core.Model.EasingMode.EaseInOut;
                arcScaleComponent.EasingFunction  = new BackEase();
                arglbl.Text = argPer;

                arcScaleComponent.Value = fValue;

                arcScaleComponent.Ranges.Clear();

                //if (fValue >= Convert.ToDouble(argGreen))
                //{
                //    arglbl.AppearanceText.TextBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:Green");
                //}
                //else if (fValue > Convert.ToDouble(argYellow))
                //{

                //    arglbl.AppearanceText.TextBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:Yellow");
                //}
                //else
                //{
                //    arglbl.AppearanceText.TextBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:Red");
                //}

                //if (fValue > fMaxValue)
                //{
                //    strMaxValue = (fValue + 1).ToString();
                //    arcScaleComponent.MaxValue = Convert.ToSingle(strMaxValue);
                //}
                //else
                //{
                //    arcScaleComponent.MaxValue = fMaxValue +1;
                //}


                if (fValue >= Convert.ToDouble(argGreen))
                {
                    arglbl.AppearanceText.TextBrush   = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:Green");
                    arcScaleRangeGreen.StartThickness = 18;
                    arcScaleRangeGreen.EndThickness   = 18;
                    arcScaleRangeGreen.Name           = "Range2";
                    arcScaleRangeGreen.ShapeOffset    = -10F;
                    arcScaleRangeGreen.StartValue     = 0;
                    arcScaleRangeGreen.EndValue       = Convert.ToSingle(fValue);
                    arcScaleRangeGreen.AppearanceRange.ContentBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:Green");

                    arcScaleComponent.Ranges.AddRange(new DevExpress.XtraGauges.Core.Model.IRange[] { arcScaleRangeGreen });
                }
                else if (fValue > Convert.ToDouble(argYellow))
                {
                    arglbl.AppearanceText.TextBrush    = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:Yellow");
                    arcScaleRangeYellow.StartThickness = 18;
                    arcScaleRangeYellow.EndThickness   = 18;
                    arcScaleRangeYellow.Name           = "Range1";
                    arcScaleRangeYellow.ShapeOffset    = -10F;
                    arcScaleRangeYellow.StartValue     = 0;
                    arcScaleRangeYellow.EndValue       = Convert.ToSingle(fValue);
                    arcScaleRangeYellow.AppearanceRange.ContentBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:Yellow");
                    arcScaleComponent.Ranges.AddRange(new DevExpress.XtraGauges.Core.Model.IRange[] { arcScaleRangeYellow });
                }
                else
                {
                    arglbl.AppearanceText.TextBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:Red");
                    arcScaleRangeRed.StartThickness = 18;
                    arcScaleRangeRed.EndThickness   = 18;
                    arcScaleRangeRed.Name           = "Range0";
                    arcScaleRangeRed.ShapeOffset    = -10F;
                    arcScaleRangeRed.EndValue       = Convert.ToSingle(fValue);
                    arcScaleRangeRed.AppearanceRange.ContentBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:Red");

                    arcScaleComponent.Ranges.AddRange(new DevExpress.XtraGauges.Core.Model.IRange[] { arcScaleRangeRed });
                }


                //AddRange(arcScaleComponent, "0", argYellow, argGreen, strMaxValue);
            }
            catch
            {
            }
        }
Пример #4
0
        private void chartOSD2(DataTable argDt, DevExpress.XtraGauges.Win.Gauges.Circular.ArcScaleComponent arcScaleComponent

                               , DevExpress.XtraGauges.Win.Base.LabelComponent arglbl
                               )
        {
            try
            {
                //Chart Per


                if (argDt.Rows.Count > 0)
                {
                    arcScaleComponent.Ranges.Clear();

                    DevExpress.XtraGauges.Core.Model.ArcScaleRange arcScaleRange = new DevExpress.XtraGauges.Core.Model.ArcScaleRange();
                    arcScaleComponent.EnableAnimation = false;
                    arcScaleComponent.EasingMode      = DevExpress.XtraGauges.Core.Model.EasingMode.EaseInOut;
                    arcScaleComponent.EasingFunction  = new BackEase();
                    arglbl.Text             = "0";
                    arcScaleComponent.Value = 0;

                    double dProd, dOsd;
                    double.TryParse(argDt.Rows[0][1].ToString(), out dOsd);
                    double.TryParse(argDt.Rows[1][1].ToString(), out dProd);
                    float fValue = 0;
                    if (dOsd + dProd == 0 || dProd == 0)
                    {
                        fValue = 0;
                    }
                    else
                    {
                        fValue = Convert.ToSingle(Math.Round(dOsd / (dOsd + dProd) * 100, 2));
                    }


                    arcScaleComponent.EnableAnimation = true;
                    arcScaleComponent.EasingMode      = DevExpress.XtraGauges.Core.Model.EasingMode.EaseInOut;
                    arcScaleComponent.EasingFunction  = new BackEase();
                    arcScaleComponent.Value           = fValue;

                    arglbl.Text = fValue + "%";


                    arcScaleRange.StartThickness = 18;
                    arcScaleRange.EndThickness   = 18;
                    arcScaleRange.StartValue     = 0;
                    arcScaleRange.Name           = "Range0";
                    arcScaleRange.ShapeOffset    = 29F;
                    arcScaleComponent.Ranges.Clear();
                    if (fValue > 4)
                    {
                        arcScaleRange.EndValue = 4;
                    }
                    else
                    {
                        arcScaleRange.EndValue = fValue;
                    }
                    if (fValue < Convert.ToDouble(argDt.Rows[0]["Target"].ToString()))
                    {
                        arcScaleRange.AppearanceRange.ContentBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:Green");

                        arcScaleComponent.Ranges.AddRange(new DevExpress.XtraGauges.Core.Model.IRange[] { arcScaleRange });
                        arglbl.AppearanceText.TextBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:Green");
                    }
                    else
                    {
                        arcScaleRange.AppearanceRange.ContentBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:Red");

                        arcScaleComponent.Ranges.AddRange(new DevExpress.XtraGauges.Core.Model.IRange[] { arcScaleRange });
                        arglbl.AppearanceText.TextBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:Red");
                    }
                }
            }
            catch
            {
            }
        }
Пример #5
0
        public void BindingData(DataTable dt)
        {
            try
            {
                arcScaleComponent1.EnableAnimation = false;
                arcScaleComponent1.EasingMode      = EasingMode.EaseInOut;
                arcScaleComponent1.EasingFunction  = new ElasticEase();
                arcScaleComponent1.Value           = 0;
                int iRedQty    = Convert.ToInt32(dt.Rows[0]["red_qty"]);
                int iYellewQty = Convert.ToInt32(dt.Rows[0]["yellow_qty"]);
                lblGreen.Text = ">" + iYellewQty.ToString();

                lblYellow.Text = iRedQty + " ~ " + iYellewQty.ToString() + "";

                lblRed.Text = "<" + iRedQty.ToString();
                //arcScaleComponent1.Ranges[0].EndValue = ascPOD.Ranges[1].StartValue = Convert.ToInt32(dt.Rows[0]["red_qty"]);

                //arcScaleComponent1.Ranges[1].EndValue = ascPOD.Ranges[2].StartValue = Convert.ToInt32(dt.Rows[0]["yellow_qty"]);
                //arcScaleComponent1.Ranges[2].EndValue = Convert.ToInt32(dt.Rows[0]["MAX_QTY"]);
                //arcScaleComponent1.MaxValue = Convert.ToInt32(dt.Rows[0]["MAX_QTY"]);

                //arcScaleComponent1.EnableAnimation = true;
                //arcScaleComponent1.EasingMode = EasingMode.EaseInOut;
                //arcScaleComponent1.EasingFunction = new BackEase();
                string strvalue = dt.Rows[0]["QTY"].ToString() == "" ? "0" : dt.Rows[0]["QTY"].ToString();
                arcScaleComponent1.Value = Convert.ToSingle(strvalue);
                labelComponent1.Text     = Convert.ToDouble(strvalue).ToString("#.0");
                //arcScaleComponent1.MinValue = 0;
                //arcScaleComponent1.Ranges[0].StartValue = 0;


                DevExpress.XtraGauges.Core.Model.ArcScaleRange arcScaleRange = new DevExpress.XtraGauges.Core.Model.ArcScaleRange();
                if (Convert.ToSingle(strvalue) > iYellewQty)
                {
                    arcScaleRange.AppearanceRange.ContentBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:Green");
                    arcScaleRange.EndValue       = Convert.ToSingle(strvalue);
                    arcScaleRange.EndThickness   = 14F;
                    arcScaleRange.ShapeOffset    = -15F;
                    arcScaleRange.StartThickness = 14F;
                    arcScaleRange.Name           = "Range0";
                    arcScaleComponent1.Ranges.AddRange(new DevExpress.XtraGauges.Core.Model.IRange[] { arcScaleRange });
                    labelComponent2.Text = strvalue;
                    //labelComponent2.AppearanceText.TextBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:White");
                    //labelComponent2.AppearanceBackground.ContentBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:Green");
                }
                else if (Convert.ToSingle(strvalue) >= iRedQty && Convert.ToSingle(strvalue) <= iYellewQty)
                {
                    arcScaleRange.AppearanceRange.ContentBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:Yellow");
                    arcScaleRange.EndValue       = Convert.ToSingle(strvalue);
                    arcScaleRange.EndThickness   = 14F;
                    arcScaleRange.ShapeOffset    = -15F;
                    arcScaleRange.StartThickness = 14F;
                    arcScaleRange.Name           = "Range0";
                    arcScaleComponent1.Ranges.AddRange(new DevExpress.XtraGauges.Core.Model.IRange[] { arcScaleRange });
                    labelComponent2.Text = strvalue;
                    //labelComponent2.AppearanceText.TextBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:Black");
                    //labelComponent2.AppearanceBackground.ContentBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:Yellow");
                }
                else
                {
                    arcScaleRange.AppearanceRange.ContentBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:Red");
                    arcScaleRange.EndValue       = Convert.ToSingle(strvalue);
                    arcScaleRange.EndThickness   = 14F;
                    arcScaleRange.ShapeOffset    = -15F;
                    arcScaleRange.StartThickness = 14F;
                    arcScaleRange.Name           = "Range0";
                    arcScaleRange.EndValue       = Convert.ToSingle(strvalue);
                    arcScaleComponent1.Ranges.AddRange(new DevExpress.XtraGauges.Core.Model.IRange[] { arcScaleRange });
                    labelComponent2.Text = strvalue;
                    //labelComponent2.AppearanceText.TextBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:White");
                    //labelComponent2.AppearanceBackground.ContentBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:Red");
                }
            }
            catch (Exception ex)
            { }
        }