Exemplo n.º 1
0
    public void SetGuageLayout2(GaugeContainer iGauge, GAUGE_COLOR_TYPE iColorType, double iRate)
    {
        Font fntDefault = new Font("", 12f, FontStyle.Regular, GraphicsUnit.Pixel);

        // Gauge 기본설정
        iGauge.Height     = Unit.Pixel(130);
        iGauge.Width      = Unit.Pixel(200);
        iGauge.AutoLayout = true;

        iGauge.BackFrame.BorderColor  = Color.FromArgb(212, 208, 200);
        iGauge.BackFrame.BorderWidth  = 0;
        iGauge.BackFrame.FrameWidth   = 0f;
        iGauge.BackFrame.FrameStyle   = BackFrameStyle.None;
        iGauge.BackFrame.FrameShape   = BackFrameShape.AutoShape;
        iGauge.BackFrame.ShadowOffset = 0f;
        iGauge.BackFrame.BorderStyle  = GaugeDashStyle.NotSet;

        //iGauge.MapAreas.Clear();
        //iGauge.StateIndicators.Clear();

        // 원형게이지 설정
        iGauge.CircularGauges.Clear();
        iGauge.CircularGauges.Add("Default");
        CircularGauge cclg = iGauge.CircularGauges[0];

        cclg.Size.Width   = 100f;
        cclg.Size.Height  = 96f;
        cclg.PivotPoint.X = 50f;
        cclg.PivotPoint.Y = 87f;

        cclg.BackFrame.BackGradientType  = Dundas.Gauges.WebControl.GradientType.None;
        cclg.BackFrame.BorderColor       = Color.Transparent;
        cclg.BackFrame.BorderWidth       = 0;
        cclg.BackFrame.FrameGradientType = Dundas.Gauges.WebControl.GradientType.None;
        cclg.BackFrame.FrameStyle        = BackFrameStyle.None;
        cclg.BackFrame.FrameShape        = BackFrameShape.AutoShape;
        cclg.BackFrame.FrameWidth        = 0f;
        cclg.Location.X = 0f;
        cclg.Location.Y = 0f;

        cclg.Knobs.Clear();
        cclg.Ranges.Clear();

        // 게이지 제목 설정
        iGauge.Labels.Clear();
        iGauge.Labels.Add("Default");


        GaugeLabel gglt = iGauge.Labels[0];

        gglt.BackColor        = Color.Transparent;
        gglt.BackGradientType = Dundas.Gauges.WebControl.GradientType.None;
        //gglt.Parent = cclg.Name;
        gglt.Text          = "달성율(%)";
        gglt.TextAlignment = ContentAlignment.MiddleCenter;
        gglt.Size.Height   = 11f;
        gglt.Size.Width    = 30f;
        gglt.Location.X    = 36f;
        gglt.Location.Y    = 46f;
        gglt.Font          = fntDefault;

        // 게이지 눈금 설정
        cclg.Scales.Clear();
        cclg.Scales.Add("Default");
        CircularScale ccls = cclg.Scales[0];

        ccls.BorderColor      = Color.Gray;
        ccls.FillColor        = ColorTranslator.FromHtml("#5A78AF"); // #ADC9DC
        ccls.Radius           = 73f;
        ccls.ShadowOffset     = 0f;
        ccls.StartAngle       = 80f;
        ccls.SweepAngle       = 200f;
        ccls.Width            = 25f;
        ccls.FillGradientType = Dundas.Gauges.WebControl.GradientType.None;
        ccls.FillHatchStyle   = GaugeHatchStyle.None;

        ccls.LabelStyle.DistanceFromScale = 5f;
        ccls.LabelStyle.Placement         = Placement.Inside;
        ccls.LabelStyle.TextColor         = Color.Black;
        ccls.LabelStyle.Font = fntDefault;

        ccls.MajorTickMark.BorderColor       = ColorTranslator.FromHtml("#E0E8F3");
        ccls.MajorTickMark.BorderWidth       = 0;
        ccls.MajorTickMark.DistanceFromScale = 1f;
        ccls.MajorTickMark.FillColor         = ColorTranslator.FromHtml("#E0E8F3");
        ccls.MajorTickMark.Length            = ccls.Width;
        ccls.MajorTickMark.Placement         = Placement.Cross;
        ccls.MajorTickMark.Shape             = Dundas.Gauges.WebControl.MarkerStyle.None;
        ccls.MajorTickMark.Width             = 5f;
        ccls.MajorTickMark.EnableGradient    = false;

        ccls.MinorTickMark.Visible           = false;
        ccls.MinorTickMark.BorderColor       = ccls.MajorTickMark.BorderColor;
        ccls.MinorTickMark.BorderWidth       = 1;
        ccls.MinorTickMark.DistanceFromScale = 1f;
        ccls.MinorTickMark.FillColor         = ccls.MajorTickMark.FillColor;
        ccls.MinorTickMark.Length            = 7f;
        ccls.MinorTickMark.Placement         = Placement.Outside;
        ccls.MinorTickMark.Shape             = Dundas.Gauges.WebControl.MarkerStyle.Wedge;
        ccls.MinorTickMark.Width             = 2f;
        ccls.MinorTickMark.EnableGradient    = false;

        // 게이지 바늘 설정
        cclg.Pointers.Clear();
        cclg.Pointers.Add("Default");
        CircularPointer cclp = cclg.Pointers[0];

        cclp.BorderWidth          = 0;
        cclp.FillGradientEndColor = Color.MediumTurquoise;
        cclp.DistanceFromScale    = 1f;
        cclp.FillColor            = Color.Red;
        cclp.FillGradientEndColor = Color.Pink;
        cclp.FillGradientType     = Dundas.Gauges.WebControl.GradientType.LeftRight;
        cclp.NeedleStyle          = NeedleStyle.NeedleStyle4;
        cclp.Placement            = Placement.Cross;
        cclp.Width                   = 2f;
        cclp.ShadowOffset            = 3f;
        cclp.CapFillColor            = ColorTranslator.FromHtml("#DFE8ED");
        cclp.CapFillGradientEndColor = ColorTranslator.FromHtml("#508EBF");
        cclp.CapFillGradientType     = Dundas.Gauges.WebControl.GradientType.DiagonalLeft;
        cclp.CapReflection           = true;
        cclp.CapWidth                = 50f;

        double dMax = iRate;

        if (100 < iRate)
        {
            dMax = (iRate - (iRate % 20)) + 20;
            //dMax = Math.Round(iRate,0);
        }
        else
        {
            dMax = 100;
        }

        cclp.Value    = iRate;
        ccls.Maximum  = dMax;
        ccls.Minimum  = 0;
        ccls.Interval = Math.Round(dMax / 10);

        gglt.Text = Math.Round(iRate, 0).ToString() + "%";
    }
Exemplo n.º 2
0
    /// <summary>
    /// 주요지표 스키마 추가 및 데이터 바인딩
    /// YMD | E | G | W | A | 매출액 | 공급량 | ...
    /// </summary>
    /// <returns></returns>
    //public DataTable GetGradeSchema(DataTable iDt)
    //{
    //    DateTime startYM = (DateTime.ParseExact(this.IYmd, "yyyyMM", null)).AddYears(-1);
    //    DataTable dtGrade = iDt;
    //    Biz_Bsc_Kpi_Dashboard objTC = new Biz_Bsc_Kpi_Dashboard();
    //    DataSet dsGrade = objTC.GetDashBoardKpiList(this.IEstTermRefID);
    //    DataRow drGrade = null;

    //    iRow = dsGrade.Tables[0].Rows.Count;
    //    for (int i = 0; i < iRow; i++)
    //    {
    //            DataColumn dc = dtGrade.Columns.Add(dsGrade.Tables[0].Rows[i]["KPI_REF_ID"].ToString(), typeof(decimal));
    //            dc.Caption    = dsGrade.Tables[0].Rows[i]["NAME_KNAME"].ToString();
    //    }

    //    DataSet actDs = new DataSet();

    //    string sKpiNm   = "";
    //    string sUnitNm  = "";
    //    decimal dTarget = 0;
    //    decimal dResult = 0;
    //    double dAVRate  = 0;
    //    string sColT = (this.ISumType == "MS") ? "TARGET_MS" : "TARGET_TS";
    //    string sColR = (this.ISumType == "MS") ? "RESULT_MS" : "RESULT_TS";
    //    string sColA = (this.ISumType == "MS") ? "ACHV_RATE_MS" : "ACHV_RATE_TS";

    //    if (dsGrade.Tables.Count > 0)
    //    {
    //        iRow = dsGrade.Tables[0].Rows.Count;
    //        for (int i = 0; i < iRow; i++)
    //        {
    //            this.IKpiRefID = int.Parse(dsGrade.Tables[0].Rows[i]["KPI_REF_ID"].ToString());
    //            actDs = objTC.GetDashBoardForKpiAnalysis( this.IEstTermRefID, this.IKpiRefID
    //                                                    , base.GetYMDFromDateTime(startYM, "").Substring(0, 6)
    //                                                    , this.IYmd, this.ISumType);

    //            if (actDs.Tables.Count > 0)
    //            {
    //                if (actDs.Tables[0].Rows.Count > 0)
    //                {
    //                    string sYmd = "";
    //                    for (int k = 0; k < dtGrade.Rows.Count; k++)
    //                    {
    //                        if (sYmd.Equals(dtGrade.Rows[k][COL_KEY.KEY_FIELD.ToString()].ToString()) && dtGrade.Columns.Contains(sKey))
    //                        {
    //                            dtGrade.Rows[k][sKey] = dVal;
    //                        }
    //                    }



    //                    dTarget = decimal.Parse(actDs.Tables[0].Rows[0][sColT].ToString());
    //                    dResult = decimal.Parse(actDs.Tables[0].Rows[0][sColR].ToString());
    //                    dAVRate = double.Parse(actDs.Tables[0].Rows[0][sColA].ToString());
    //                }
    //            }
    //        }
    //    }

    //    return dtGrade;
    //}


    #endregion

    #region [지표현황 - 게이지 설정]
    public void SetGuageLayout(GaugeContainer iGauge, GAUGE_COLOR_TYPE iColorType)
    {
        iGauge.Height     = Unit.Pixel(130);
        iGauge.Width      = Unit.Pixel(240);
        iGauge.AutoLayout = false;

        iGauge.BackFrame.BorderColor  = Color.FromArgb(212, 208, 200);
        iGauge.BackFrame.BorderWidth  = 0;
        iGauge.BackFrame.FrameWidth   = 0f;
        iGauge.BackFrame.FrameStyle   = BackFrameStyle.None;
        iGauge.BackFrame.FrameShape   = BackFrameShape.AutoShape;
        iGauge.BackFrame.ShadowOffset = 0f;
        iGauge.BackFrame.BorderStyle  = GaugeDashStyle.NotSet;

        iGauge.CircularGauges.Clear();
        iGauge.CircularGauges.Add("Default");
        CircularGauge cclg = iGauge.CircularGauges[0];

        cclg.Size.Width                     = 100f;
        cclg.Size.Height                    = 96f;
        cclg.PivotPoint.X                   = 50f;
        cclg.PivotPoint.Y                   = 87f;
        cclg.BackFrame.BackColor            = arrColor[(int)iColorType, 0];
        cclg.BackFrame.BackGradientEndColor = arrColor[(int)iColorType, 1];
        cclg.BackFrame.BackGradientType     = Dundas.Gauges.WebControl.GradientType.TopBottom;
        cclg.BackFrame.BorderColor          = Color.DarkGray;
        cclg.BackFrame.BorderWidth          = 2;
        cclg.BackFrame.FrameGradientType    = Dundas.Gauges.WebControl.GradientType.None;
        cclg.BackFrame.FrameStyle           = BackFrameStyle.Edged;
        cclg.BackFrame.FrameShape           = BackFrameShape.AutoShape;
        cclg.BackFrame.FrameWidth           = 0f;
        cclg.Location.X                     = 0f;
        cclg.Location.Y                     = 0f;

        cclg.Ranges.Clear();
        //cclg.Ranges.Add("Alert");
        //CircularRange cclr = cclg.Ranges[0];
        //cclr.StartValue = 0;
        //cclr.EndValue   = 50;
        //cclr.StartWidth = 200f;
        //cclr.EndWidth   = 200f;

        iGauge.Labels.Clear();
        iGauge.Labels.Add("Default");
        GaugeLabel gglt = iGauge.Labels[0];

        gglt.BackColor        = Color.Transparent;
        gglt.BackGradientType = Dundas.Gauges.WebControl.GradientType.None;
        //gglt.Parent = cclg.Name;
        gglt.Text          = "단위";
        gglt.TextAlignment = ContentAlignment.MiddleCenter;
        gglt.Size.Height   = 11f;
        gglt.Size.Width    = 30f;
        gglt.Location.X    = 36f;
        gglt.Location.Y    = 46f;


        cclg.Scales.Clear();
        cclg.Scales.Add("Default");
        CircularScale ccls = cclg.Scales[0];

        ccls.BorderColor  = Color.Gray;
        ccls.FillColor    = Color.Black;
        ccls.Radius       = 58f;
        ccls.ShadowOffset = 0f;
        ccls.StartAngle   = 90f;
        ccls.SweepAngle   = 180f;
        ccls.Width        = 1f;

        ccls.LabelStyle.DistanceFromScale = 5f;
        ccls.LabelStyle.Placement         = Placement.Outside;
        ccls.LabelStyle.TextColor         = Color.Black;

        ccls.MajorTickMark.BorderColor       = Color.Black;
        ccls.MajorTickMark.BorderWidth       = 1;
        ccls.MajorTickMark.DistanceFromScale = 1f;
        ccls.MajorTickMark.FillColor         = Color.Black;
        ccls.MajorTickMark.Length            = 10f;
        ccls.MajorTickMark.Placement         = Placement.Outside;
        ccls.MajorTickMark.Shape             = Dundas.Gauges.WebControl.MarkerStyle.Wedge;
        ccls.MajorTickMark.Width             = 2f;

        ccls.MinorTickMark.BorderColor       = ccls.MajorTickMark.BorderColor;
        ccls.MinorTickMark.BorderWidth       = 1;
        ccls.MinorTickMark.DistanceFromScale = 1f;
        ccls.MinorTickMark.FillColor         = ccls.MajorTickMark.FillColor;
        ccls.MinorTickMark.Length            = 7f;
        ccls.MinorTickMark.Placement         = Placement.Outside;
        ccls.MinorTickMark.Shape             = Dundas.Gauges.WebControl.MarkerStyle.Wedge;
        ccls.MinorTickMark.Width             = 2f;
        ccls.MinorTickMark.EnableGradient    = false;

        cclg.Pointers.Clear();
        CircularPointer cclp = cclg.Pointers[0];

        cclp.BorderWidth          = 0;
        cclp.CapFillColor         = Color.Silver;
        cclp.FillGradientEndColor = Color.MediumTurquoise;
        cclp.CapReflection        = true;
        cclp.CapWidth             = 20f;
        cclp.DistanceFromScale    = 1f;
        cclp.FillColor            = Color.Red;
        cclp.FillGradientEndColor = Color.Pink;
        cclp.FillGradientType     = Dundas.Gauges.WebControl.GradientType.LeftRight;
        cclp.NeedleStyle          = NeedleStyle.NeedleStyle4;
        cclp.Placement            = Placement.Outside;
        cclp.Width = 13f;

        cclp.SnappingEnabled  = true;
        cclp.SnappingInterval = 1;


        cclp.Value   = 50;
        ccls.Maximum = 100;
        ccls.Minimum = 0;
    }