예제 #1
0
    private void SetKpiStatusGraph()
    {
        this.SetParameter(this.IEstDeptID);

        MicroBSC.BSC.Biz.Biz_Bsc_Kpi_Dashboard objBSC = new MicroBSC.BSC.Biz.Biz_Bsc_Kpi_Dashboard();
        DataSet rDs = objBSC.GetAllList(this.IEstTermRefID);

        int cntRow = 0;
        int cntCol = 0;

        int    intEsttermRefID = 0;
        int    intKpiRefID     = 0;
        string strTrendType    = "";
        string strKpiName      = "";
        string strTypeName     = "";

        cntRow = rDs.Tables[0].Rows.Count;
        cntCol = rDs.Tables[0].Columns.Count;

        Chart objChart = null;

        for (int i = 0; i < cntRow; i++)
        {
            intEsttermRefID = Convert.ToInt32(rDs.Tables[0].Rows[i]["ESTTERM_REF_ID"].ToString());
            intKpiRefID     = Convert.ToInt32(rDs.Tables[0].Rows[i]["KPI_REF_ID"].ToString());
            strTrendType    = Convert.ToString(rDs.Tables[0].Rows[i]["SELECT_TYPE"].ToString());
            strKpiName      = Convert.ToString(rDs.Tables[0].Rows[i]["KPI_NAME"].ToString());
            strTypeName     = Convert.ToString(rDs.Tables[0].Rows[i]["SELECT_TYPE_NAME"].ToString());

            DataSet dsGraph = objBSC.GetDashBoardForKpiAnalysis(intEsttermRefID
                                                                , intKpiRefID
                                                                , this.IYmd
                                                                , "99999999"
                                                                , this.ISumType);

            switch (i)
            {
            case 0:
                objChart         = chtKPI1;
                objChart.Visible = true;
                break;

            case 1:
                objChart         = chtKPI2;
                objChart.Visible = true;
                break;

            case 2:
                objChart         = chtKPI3;
                objChart.Visible = true;
                break;

            case 3:
                objChart         = chtKPI4;
                objChart.Visible = true;
                break;

            case 4:
                objChart         = chtKPI5;
                objChart.Visible = true;
                break;

            case 5:
                objChart         = chtKPI6;
                objChart.Visible = true;
                break;

            default:
                return;
            }

            DundasCharts.DundasChartBase(objChart
                                         , ChartImageType.Flash
                                         , 300
                                         , 100
                                         , BorderSkinStyle.Emboss, Color.FromArgb(26, 59, 105), 2
                                         , Color.FromArgb(211, 223, 240)
                                         , Color.FromArgb(255, 255, 255)
                                         , Color.FromArgb(37, 58, 118)
                                         , ChartDashStyle.Solid
                                         , -1
                                         , ChartHatchStyle.None
                                         , GradientType.TopBottom
                                         , AntiAliasing.None);

            Series serKpi = DundasCharts.CreateSeries(objChart
                                                      , strTypeName
                                                      , objChart.ChartAreas[0].Name
                                                      , strTypeName
                                                      , null
                                                      , SeriesChartType.FastLine
                                                      , 2
                                                      , GetSignalColor(i)
                                                      , GetChartColor(i)
                                                      , Color.FromArgb(64, 0, 0, 0)
                                                      , 1
                                                      , 9
                                                      , Color.FromArgb(64, 64, 64));

            objChart.ChartAreas[objChart.Series[serKpi.Name].ChartArea].AxisX.Interval          = 4;
            objChart.ChartAreas[objChart.Series[serKpi.Name].ChartArea].Area3DStyle.Enable3D    = false;
            objChart.ChartAreas[objChart.Series[serKpi.Name].ChartArea].AxisY2.Enabled          = AxisEnabled.False;
            objChart.ChartAreas[objChart.Series[serKpi.Name].ChartArea].AxisY.LabelStyle.Format = "#,##0";


            //string strHerf = HttpContext.Current.Request.Url.ToString().Substring(0, HttpContext.Current.Request.Url.ToString().LastIndexOf('/'))
            //                                                                        + "/BSC0304S2.aspx?"
            //                                                                        + "ESTTERM_REF_ID=" + intEsttermRefID.ToString()
            //                                                                        + "&KPI_REF_ID="    + intKpiRefID.ToString()
            //                                                                        + "&YMD="           + this.IYmd;
            string strURL  = "gfOpenWindow('../BSC/BSC0304S2.aspx?iType=POP&ESTTERM_REF_ID=" + intEsttermRefID.ToString() + "&KPI_REF_ID=" + intKpiRefID.ToString() + "&YMD=" + this.IYmd + ", 840, 600, 'no', 'no');";
            string strHerf = HttpContext.Current.Request.Url.ToString().Substring(0, HttpContext.Current.Request.Url.ToString().LastIndexOf('/')) + strURL;


            objChart.DataSource  = dsGraph;
            serKpi.ValueMembersY = "RESULT_VALUE";
            serKpi.ValueMemberX  = "YMD";
            objChart.DataBind();
            objChart.Legends[0].Enabled = false;

            objChart.Titles[0].Text = strKpiName;
            objChart.Titles[0].Href = strHerf;

            dsGraph  = null;
            serKpi   = null;
            objChart = null;
        }
    }
예제 #2
0
    //private void SetResultGrid()
    //{

    //    Biz_Bsc_Kpi_Info objBSC = new Biz_Bsc_Kpi_Info();



    //    DataSet ds = objBSC.GetKpiListForResultAnalysis(this.IEstTermRefID
    //                                                                   , this.IYmd
    //                                                                   , ""
    //                                                                   , ""
    //                                                                   , ""
    //                                                                   , ""
    //                                                                   , this.IDeptID
    //                                                                   , 1 // 우수
    //                                                                   , this.ISumType
    //                                                                   , ""
    //                                                                   , "");

    //    if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
    //    {
    //        ds.Tables[0].Columns.Add("RANK", typeof(int));
    //        ds.Tables[0].Columns.Add("SORT_TYPE", typeof(string));

    //        DataTable dataTable = null;

    //        // 순위정렬 성격에 따라 처리 내용
    //        dataTable = PageUtility.FilterSortData(ds.Tables[0], "", "ACHIEVE_RATE_DIFF DESC");
    //        SetRowNum(dataTable, "H");

    //        // DataRow 삭제
    //        DeleteExtraRowsByRowNum(dataTable, 10);

    //        ugrdResultStatus.Clear();
    //        ugrdResultStatus.DataSource = dataTable;
    //        ugrdResultStatus.DataBind();
    //    }

    //}

    private void SetKpiStatusGraph()
    {
        this.SetParameter();

        MicroBSC.BSC.Biz.Biz_Bsc_Kpi_Dashboard objBSC = new MicroBSC.BSC.Biz.Biz_Bsc_Kpi_Dashboard();
        DataSet rDs = objBSC.GetAllList(this.IEstTermRefID);

        int cntRow = 0;
        int cntCol = 0;


        int    intEsttermRefID = 0;
        int    intKpiRefID     = 0;
        string strTrendType    = "";
        string strKpiName      = "";
        string strTypeName     = "";

        cntRow = rDs.Tables[0].Rows.Count;
        cntCol = rDs.Tables[0].Columns.Count;
        Dundas.Charting.WebControl.Chart objChart = null;

        for (int i = 0; i < cntRow; i++)
        {
            intEsttermRefID = Convert.ToInt32(rDs.Tables[0].Rows[i]["ESTTERM_REF_ID"].ToString());
            intKpiRefID     = Convert.ToInt32(rDs.Tables[0].Rows[i]["KPI_REF_ID"].ToString());
            strTrendType    = Convert.ToString(rDs.Tables[0].Rows[i]["SELECT_TYPE"].ToString());
            strKpiName      = Convert.ToString(rDs.Tables[0].Rows[i]["KPI_NAME"].ToString());
            strTypeName     = Convert.ToString(rDs.Tables[0].Rows[i]["SELECT_TYPE_NAME"].ToString());

            DataSet dsGraph = objBSC.GetDashBoardForKpiAnalysis(intEsttermRefID, intKpiRefID, "00000000", this.IYmd, this.ISumType);
            //DataSet dsGraph = objBSC.GetDashBoardForKpiAnalysis(intEsttermRefID, intKpiRefID, this.IYmd, "99999999", this.ISumType);



            switch (i)
            {
            case 0:
                objChart         = chtKPI1;
                objChart.Visible = true;
                break;

            case 1:
                objChart         = chtKPI2;
                objChart.Visible = true;
                break;

            case 2:
                objChart         = chtKPI3;
                objChart.Visible = true;
                break;

            case 3:
                objChart         = chtKPI4;
                objChart.Visible = true;
                break;

            case 4:
                objChart         = chtKPI5;
                objChart.Visible = true;
                break;

            case 5:
                objChart         = chtKPI6;
                objChart.Visible = true;
                break;

            default:
                return;
            }

            DundasCharts.DundasChartBase(objChart
                                         , Dundas.Charting.WebControl.ChartImageType.Flash
                                         , 400, 200
                                         , Dundas.Charting.WebControl.BorderSkinStyle.None
                                         , Color.FromArgb(181, 64, 1)
                                         , 0
                                         , Color.FromArgb(0xFF, 0xFF, 0xFE)
                                         , Color.FromArgb(0xFF, 0xFF, 0xFE)
                                         , Color.FromArgb(0x20, 0x80, 0xD0)
                                         , Dundas.Charting.WebControl.ChartDashStyle.Solid
                                         , -1
                                         , Dundas.Charting.WebControl.ChartHatchStyle.None
                                         , Dundas.Charting.WebControl.GradientType.TopBottom
                                         , Dundas.Charting.WebControl.AntiAliasing.None);

            //MSCharts.DundasChartBase(objChart, ChartImageType.Jpeg, 400, 300
            //    , BorderSkinStyle.Emboss, Color.FromArgb(26, 59, 105), 2
            //    , Color.FromArgb(211, 223, 240)
            //    , Color.FromArgb(255, 255, 255), Color.FromArgb(37, 58, 118), ChartDashStyle.Solid
            //    , -1
            //    , ChartHatchStyle.None, MsGradientType.TopBottom, MsAntiAliasing.None);



            objChart.DataSource = dsGraph;

            Dundas.Charting.WebControl.Series series1 = DundasCharts.CreateSeries(objChart, objChart.ChartAreas[0].Name,
                                                                                  "Default",
                                                                                  strKpiName, null, Dundas.Charting.WebControl.SeriesChartType.Column, 1,
                                                                                  GetSignalColor(i), GetChartColor2(i), Color.FromArgb(64, 0, 0, 0), 1, 9, Color.FromArgb(64, 64, 64));


            objChart.ChartAreas[0].AxisX.Interval = 1;

            string strHerf = HttpContext.Current.Request.Url.ToString().Substring(0, HttpContext.Current.Request.Url.ToString().LastIndexOf('/')) + "/BSC0304S2.aspx?ESTTERM_REF_ID=" + intEsttermRefID.ToString() + "&KPI_REF_ID=" + intKpiRefID.ToString() + "&YMD=" + this.IYmd;


            series1.Color        = GetChartColor2(i);
            series1.BorderWidth  = 0;
            series1.ShadowOffset = 0;
            //series1.BorderColor = GetChartColor2(0);
            series1.Label = "#VALY{N0}";

            series1.ValueMembersY = "RESULT_VALUE";
            series1.ValueMemberX  = "YMD";


            series1.ToolTip = "#VALY{N0}";

            objChart.Series[objChart.ChartAreas[0].Name]["PointWidth"] = "0.5";

            //string sChartArea2 = chart.Series[series2.Name].ChartArea;
            //chart.ChartAreas[sChartArea2].AxisY.LabelStyle.Format = "P0";
            //chart.ChartAreas[sChartArea2].AxisY.IsStartedFromZero = false;
            //chart.ChartAreas[sChartArea2].AxisX.IsMarginVisible = true;
            //chart.ChartAreas[sChartArea2].AxisY2.Enabled = AxisEnabled.False;

            //DoSettingChartStyles(chart,"#%");

            // Show as 3D
            //if (rdoChartType.SelectedIndex == 0)
            //    chart.ChartAreas[sChartArea2].Area3DStyle.Enable3D = false;
            //else
            //    chart.ChartAreas[sChartArea2].Area3DStyle.Enable3D = true;

            DundasAnimations.DundasChartBase(objChart, AnimationTheme.None, -1, -1, false, 1);
            DundasAnimations.GrowingAnimation(objChart, series1, 0.5, 2.0, true);

            objChart.DataBind();

            dsGraph = null;

            objChart = null;
        }
    }