Пример #1
0
    //private void SetDropDownListItem(System.Web.UI.WebControls.DropDownList ddlItem)
    //{
    //    string query = @"SELECT DISTINCT ITMU_IDX, ITMU_NAME FROM D_ITEM_UTIL";
    //    dbAgent = new DBAgent(System.Configuration.ConfigurationManager.ConnectionStrings["EISDB"].ConnectionString);
    //    DataSet ds = dbAgent.FillDataSet(query, "Data");
    //    ddlItem.DataSource = ds;
    //    ddlItem.DataValueField  = "ITMU_IDX";
    //    ddlItem.DataTextField   = "ITMU_NAME";
    //    ddlItem.DataBind();
    //}
    private void BindingChart_1(Dundas.Charting.WebControl.Chart chart, string yearStr)
    {
        string query_item = @"SELECT PAN_ITMNM from D_ITEM_PANMAE WHERE PAN_ITMNM LIKE '%락탐%' GROUP BY PAN_ITMNM";

        dbAgent = new DBAgent(System.Configuration.ConfigurationManager.ConnectionStrings["EISDB"].ConnectionString);
        DataSet ds_item = dbAgent.FillDataSet(query_item, "Data");

        //chart.DataSource = GetChartDataTable_1(yearStr).DefaultView;
        //DataGrid1.DataSource = GetChartDataTable(yearStr).DefaultView;
        //DataGrid1.DataBind();

        DataTable dt = GetChartDataTable_1(yearStr);

        DundasCharts.DundasChartBase(chart, ChartImageType.Flash, 800, 182
                                     , BorderSkinStyle.Emboss, Color.FromArgb(181, 64, 1), 2
                                     , Color.FromArgb(0xFF, 0xFF, 0xFE)
                                     , Color.FromArgb(0xFF, 0xFF, 0xFE), Color.FromArgb(0x20, 0x80, 0xD0), ChartDashStyle.Solid
                                     , -1
                                     , ChartHatchStyle.None, GradientType.TopBottom, AntiAliasing.None);

        Series series = null;

        DundasAnimations.DundasChartBase(chart, AnimationTheme.None, -1, -1, false, 1);

        for (int i = 0; i < ds_item.Tables[0].Rows.Count; i++)
        {
            series = DundasCharts.CreateSeries(chart, "Series" + i.ToString(), "Default", ds_item.Tables[0].Rows[i]["PAN_ITMNM"].ToString(), null, SeriesChartType.Line, 3, GetChartColor(i), GetChartColor(i), Color.FromArgb(64, 0, 0, 0), 1, 9, Color.FromArgb(64, 64, 64));
            //series.ValueMembersY = "C_" + ds_item.Tables[0].Rows[i]["PAN_IDX"].ToString();
            DatabaseBindingXY(series, "MONTH", "C_" + ds_item.Tables[0].Rows[i]["PAN_ITMNM"].ToString(), dt);
            DundasAnimations.GrowingAnimation(chart, series, i, (i + 1), false);
            if (ds_item.Tables[0].Rows[i]["PAN_ITMNM"].ToString() == "용융락탐")
            {
                series.YAxisType = AxisType.Secondary;
            }
            series.MarkerStyle       = GetMarkerStyle(i);
            series.MarkerColor       = GetChartColor(i);
            series.MarkerBorderColor = GetChartColor(i);
            series.ToolTip           = "#VALY{N0}";

            //if (ds_item.Tables[0].Rows[i]["PAN_ITMNM"].ToString().IndexOf("공업용유안25Kg(Pk)") < 0)
            //    series.YAxisType = AxisType.Secondary;

            string sChartArea = chart.Series[series.Name].ChartArea;
            chart.ChartAreas[sChartArea].AxisY.LabelStyle.Format  = "N0";
            chart.ChartAreas[sChartArea].AxisY2.LabelStyle.Format = "N0";

            //SetZeroPoint(chart, int.Parse(ddlYear.SelectedValue));
        }

        SetVisibleZeroPoint(chart, Convert.ToInt32(PageUtility.GetByValueDropDownList(ddlYear)));

        Font   font1  = new Font("Gulim", 9, FontStyle.Regular);
        Legend legend = DundasCharts.CreateLegend(chart, "Default", Color.Transparent, Color.Empty, Color.Empty, font1, true, -1, -1, -1, -1);

        DundasCharts.SetChartArea(chart.ChartAreas["Default"], false);
    }
Пример #2
0
    //private void SetDropDownListItem(System.Web.UI.WebControls.DropDownList ddlItem)
    //{
    //    string query = @"SELECT DISTINCT ITMU_IDX, ITMU_NAME FROM D_ITEM_UTIL";
    //    dbAgent = new DBAgent(System.Configuration.ConfigurationManager.ConnectionStrings["EISDB"].ConnectionString);
    //    DataSet ds = dbAgent.FillDataSet(query, "Data");
    //    ddlItem.DataSource = ds;
    //    ddlItem.DataValueField  = "ITMU_IDX";
    //    ddlItem.DataTextField   = "ITMU_NAME";
    //    ddlItem.DataBind();
    //}
    private void BindingChart(Dundas.Charting.WebControl.Chart chart, string yearStr)
    {
        string query_item = @"SELECT PAN_IDX, PAN_ITMNM from D_ITEM_PANMAE WHERE PAN_ITMNM LIKE '%유안%'";

        dbAgent = new DBAgent(System.Configuration.ConfigurationManager.ConnectionStrings["EISDB"].ConnectionString);
        DataSet ds_item = dbAgent.FillDataSet(query_item, "Data");

        chart.DataSource = GetChartDataTable(yearStr).DefaultView;
        //DataGrid1.DataSource = GetChartDataTable(yearStr).DefaultView;
        //DataGrid1.DataBind();

        DundasCharts.DundasChartBase(chart, ChartImageType.Flash, 800, 450
                                     , BorderSkinStyle.Emboss, Color.FromArgb(181, 64, 1), 2
                                     , Color.FromArgb(0xFF, 0xFF, 0xFE)
                                     , Color.FromArgb(0xFF, 0xFF, 0xFE), Color.FromArgb(0x20, 0x80, 0xD0), ChartDashStyle.Solid
                                     , -1
                                     , ChartHatchStyle.None, GradientType.TopBottom, AntiAliasing.None);

        Series series = null;

        DundasAnimations.DundasChartBase(chart, AnimationTheme.None, -1, -1, false, 1);

        for (int i = 0; i < ds_item.Tables[0].Rows.Count; i++)
        {
            series = DundasCharts.CreateSeries(chart, "Series" + i.ToString(), "Default", ds_item.Tables[0].Rows[i]["PAN_ITMNM"].ToString(), null, SeriesChartType.Line, 3, GetChartColor(i), GetChartColor(i), Color.FromArgb(64, 0, 0, 0), 1, 9, Color.FromArgb(64, 64, 64));
            series.ValueMembersY = "C_" + ds_item.Tables[0].Rows[i]["PAN_IDX"].ToString();
            DundasAnimations.GrowingAnimation(chart, series, 2 * i, 2 * (i + 1), false);
            series.MarkerStyle       = GetMarkerStyle(i);
            series.MarkerColor       = GetChartColor(i);
            series.MarkerBorderColor = GetChartColor(i);

            //if (ds_item.Tables[0].Rows[i]["PAN_ITMNM"].ToString().IndexOf("공업용유안25Kg(Pk)") < 0)
            //    series.YAxisType = AxisType.Secondary;

            if (i == 0)
            {
                series.ValueMemberX = "MONTH";
            }
        }

        chart.Legends.Add(new Legend("test"));
        Chart1.Legends["test"].Alignment    = StringAlignment.Center;
        Chart1.Legends["test"].Docking      = LegendDocking.Top;
        Chart1.Legends["test"].ShadowOffset = 0;
        Chart1.Legends["test"].LegendStyle  = LegendStyle.Row;
        Chart1.Legends["test"].Font         = new Font(Chart1.Legends["Default"].Font.FontFamily, 9);

        Font   font1  = new Font("Gulim", 9, FontStyle.Regular);
        Legend legend = DundasCharts.CreateLegend(Chart1, "Default", Color.Transparent, Color.Empty, Color.Empty, font1, true, -1, -1, -1, -1);

        DundasCharts.SetChartArea(Chart1.ChartAreas["Default"], false);
    }
Пример #3
0
    private void ChartBinding()
    {
        DataTable dtBond  = GetDTBond(false);
        DataTable dtChart = GetDTChart();

        //Chart1.DataSource = GetDTChart();

        #region 챠트 초기화
        DundasCharts.DundasChartBase(Chart1, ChartImageType.Flash, 800, 240
                                     , BorderSkinStyle.Emboss, Color.FromArgb(181, 64, 1), 2
                                     , Color.FromArgb(0xFF, 0xFF, 0xFE)
                                     , Color.FromArgb(0xFF, 0xFF, 0xFE), Color.FromArgb(0x20, 0x80, 0xD0), ChartDashStyle.Solid
                                     , -1
                                     , ChartHatchStyle.None, GradientType.TopBottom, AntiAliasing.None);
        #endregion

        //// 시리즈 생성
        // 시리즈 생성
        Series[] srArray = new Series[dtBond.Rows.Count];

        for (int i = 0; i < dtBond.Rows.Count; i++)
        {
            srArray[i] = DundasCharts.CreateSeries(Chart1, "", "Default", dtBond.Rows[i]["v_Name"].ToString(), null, SeriesChartType.StackedColumn, 3, GetChartColor(i), GetChartColor(i), Color.FromArgb(64, 0, 0, 0), 1, 9, Color.FromArgb(64, 64, 64));
            //srArray[i].ValueMembersY = dtBond.Rows[i]["v_Code"].ToString();
            DatabaseBindingXY(srArray[i], "YYYYMM", dtBond.Rows[i]["v_Code"].ToString(), dtChart);
            DundasAnimations.GrowingAnimation(Chart1, srArray[i], i, i + 1, true);
            srArray[i].MarkerStyle = GetMarkerStyle(i);
            srArray[i].ToolTip     = "#VALY{N0}";
            //srArray[i].ShowLabelAsValue = true;
            //SetZeroPoint(Chart1, int.Parse(PageUtility.GetByValueDropDownList(ddlYear)));
        }

        SetVisibleZeroPoint(Chart1, Convert.ToInt32(PageUtility.GetByValueDropDownList(ddlYear)));
        //srArray[0].ValueMemberX = "YYYYMM";

        string sChartArea = Chart1.Series[srArray[0].Name].ChartArea;
        Chart1.ChartAreas[sChartArea].AxisY.LabelStyle.Format = "N0";

        Font   font1  = new Font("Gulim", 9, FontStyle.Regular);
        Legend legend = DundasCharts.CreateLegend(Chart1, "Default", Color.Transparent, Color.Empty, Color.Empty, font1, true, -1, -1, -1, -1);
    }
Пример #4
0
    private void BindChart(Chart chart
                           , DataTable dt
                           , string titleName
                           , System.Web.UI.WebControls.Label lbl)
    {
        DundasCharts.DundasChartBase(chart
                                     , ChartImageType.Flash
                                     , 480
                                     , 300
                                     , BorderSkinStyle.Emboss
                                     , Color.FromArgb(181, 64, 1)
                                     , 2
                                     , Color.FromArgb(0xFF, 0xFF, 0xFE)
                                     , Color.FromArgb(0xFF, 0xFF, 0xFE)
                                     , Color.FromArgb(0x20, 0x80, 0xD0)
                                     , ChartDashStyle.Solid
                                     , -1
                                     , ChartHatchStyle.None
                                     , GradientType.TopBottom
                                     , AntiAliasing.None);

        Series series1 = DundasCharts.CreateSeries(chart
                                                   , "Series1"
                                                   , "Default"
                                                   , null
                                                   , null
                                                   , SeriesChartType.Doughnut
                                                   , 1
                                                   , GetChartColor(0)
                                                   , Color.FromArgb(0x4A, 0x58, 0x7E)
                                                   , Color.FromArgb(64, 0, 0, 0)
                                                   , 1
                                                   , 9
                                                   , Color.FromArgb(64, 64, 64));



        //series1.Label   = "#VALY{N0}";

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

        //series1.ShowLabelAsValue = true;
        //series1.ShowInLegend = true;

        chart.ChartAreas["Default"].AxisY.LabelStyle.Format = "N0";

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

        //for (int i = 0; i < dt.Rows.Count; i++)
        //{
        //    series1.Points[i].AxisLabel = dt.Rows[i]["ALIAS"].ToString();
        //}

        //for (int i = 0; i < dt.Rows.Count; i++)
        //{
        //    series1.Points.AddY(dt.Rows[i]["RESULT_TS"]);
        //}

        DataTable dtData = DataTypeUtility.FilterSortDataTable(dt, "KPI_REF_ID > 0");

        for (int i = 0; i < dtData.Rows.Count; i++)
        {
            series1.Points.AddXY(dt.Rows[i]["TEXT"].ToString(), dt.Rows[i]["RESULT_TS"]);
        }

        if (series1.Type == SeriesChartType.Pie || series1.Type == SeriesChartType.Doughnut)
        {
            for (int p = 0; p < series1.Points.Count; p++)
            {
                DataPoint point = series1.Points[p];

                point.Color = GetChartColor(p);
            }
        }

        //series1.ToolTip = "#VALY{#,##0,00}";
        //series2.ToolTip = "#VALY{#,##0}";

        //series2.MarkerStyle         = MarkerStyle.Circle;
        //series2.MarkerColor         = Color.FromArgb(0xFF, 0xAA, 0x20);
        //series2.MarkerBorderColor   = Color.FromArgb(0xD7, 0x41, 0x01);

        Font font = new Font("Gulim", 11, FontStyle.Regular);

        Dundas.Charting.WebControl.Title title = DundasCharts.CreateTitle(chart
                                                                          , "Title1"
                                                                          , titleName
                                                                          , font
                                                                          , Color.FromArgb(26, 59, 105)
                                                                          , Color.Empty
                                                                          , Color.Empty
                                                                          , ContentAlignment.TopCenter
                                                                          , null
                                                                          , Color.FromArgb(32, 0, 0, 0)
                                                                          , 3
                                                                          , false
                                                                          , 5
                                                                          , 7
                                                                          , 91
                                                                          , 6);

        Legend legend = DundasCharts.CreateLegend(chart
                                                  , "Default"
                                                  , Color.Transparent
                                                  , Color.Empty
                                                  , Color.Empty);

        series1.Font             = new Font("굴림", 8, FontStyle.Regular);
        series1["PieLabelStyle"] = "Outside";

        legend.LegendStyle = LegendStyle.Table;
        legend.AutoFitText = false;
        legend.Docking     = LegendDocking.Bottom;
        //legend.Alignment = StringAlignment.Near;
        //legend.Position = new ElementPosition(60, 7, 50, 24);
        //legend.Enabled = false;
        //legend.DockInsideChartArea = true;
        //chart.ChartAreas["Default"].AlignOrientation = AreaAlignOrientation.Horizontal;

        DundasCharts.SetChartArea(chart.ChartAreas["Default"], true);

        DataRow[] drCol = dt.Select(string.Format("KPI_REF_ID < 0"));

        if (drCol.Length > 0)
        {
            lbl.Text = DataTypeUtility.GetToDouble(drCol[0]["RESULT_TS"]).ToString("#,##0");
        }
        else
        {
            lbl.Text = "0";
        }
    }
Пример #5
0
    private void BindChart_ts(Chart chart
                              , DataTable dt
                              , DataTable dt1
                              , DataTable dt2
                              , DataTable dt3
                              , string titleName)
    {
        DundasCharts.DundasChartBase(chart
                                     , ChartImageType.Flash
                                     , 240
                                     , 160
                                     , BorderSkinStyle.Emboss
                                     , Color.FromArgb(181, 64, 1)
                                     , 2
                                     , Color.FromArgb(0xFF, 0xFF, 0xFE)
                                     , Color.FromArgb(0xFF, 0xFF, 0xFE)
                                     , Color.FromArgb(0x20, 0x80, 0xD0)
                                     , ChartDashStyle.Solid
                                     , -1
                                     , ChartHatchStyle.None
                                     , GradientType.TopBottom
                                     , AntiAliasing.None);

        Series series1 = DundasCharts.CreateSeries(chart
                                                   , "Series1"
                                                   , "Default"
                                                   , "목표"
                                                   , null
                                                   , SeriesChartType.RangeColumn
                                                   , 1
                                                   , GetChartColor(0)
                                                   , Color.FromArgb(0x4A, 0x58, 0x7E)
                                                   , Color.FromArgb(64, 0, 0, 0)
                                                   , 1
                                                   , 9
                                                   , Color.FromArgb(64, 64, 64));

        Series series2 = DundasCharts.CreateSeries(chart
                                                   , "Series2"
                                                   , "Default"
                                                   , "실적"
                                                   , null
                                                   , SeriesChartType.RangeColumn
                                                   , 1
                                                   , GetChartColor(1)
                                                   , Color.FromArgb(0xD7, 0x41, 0x01)
                                                   , Color.FromArgb(64, 0, 0, 0)
                                                   , 1
                                                   , 9
                                                   , Color.FromArgb(64, 64, 64));

        Series series3 = DundasCharts.CreateSeries(chart
                                                   , "Series3"
                                                   , "Default"
                                                   , "전년동기"
                                                   , null
                                                   , SeriesChartType.RangeColumn
                                                   , 1
                                                   , GetChartColor(2)
                                                   , Color.FromArgb(107, 148, 49)
                                                   , Color.FromArgb(64, 0, 0, 0)
                                                   , 1
                                                   , 9
                                                   , Color.FromArgb(64, 64, 64));

        //series1.Label   = "#VALY{N0}";
        //series2.Label   = "#VALY{N0}";
        //series3.Label   = "#VALY{N0}";

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

        chart.ChartAreas["Default"].AxisY.LabelStyle.Format = "N0";

        DundasAnimations.DundasChartBase(chart, AnimationTheme.None, -1, -1, false, 1);
        DundasAnimations.GrowingAnimation(chart, series1, 0.5, 1.5, true);
        DundasAnimations.GrowingAnimation(chart, series2, 0.5, 1.5, true);
        DundasAnimations.GrowingAnimation(chart, series3, 0.5, 1.5, true);

        for (int i = 0; i < dt1.Rows.Count; i++)
        {
            series1.Points.AddXY(" ", dt1.Rows[i]["VAL"]);
        }

        for (int i = 0; i < dt2.Rows.Count; i++)
        {
            series2.Points.AddXY(" ", dt2.Rows[i]["VAL"]);
        }

        for (int i = 0; i < dt3.Rows.Count; i++)
        {
            series3.Points.AddXY(" ", dt3.Rows[i]["VAL"]);
        }


        //series1.ValueMemberX    = "NAME";
        //series1.ValueMembersY   = "VAL";

        //series2.ValueMemberX    = "NAME";
        //series2.ValueMembersY   = "VAL";

        //chart.DataSource = dt1;


        //chart.DataBind();

        //series1.ToolTip = "#VALY{#,##0,00}";
        //series2.ToolTip = "#VALY{#,##0}";

        //for (int i = 0; i < dt.Rows.Count; i++)
        //{
        //    series1.Points[i].AxisLabel = xValues[i].ToString();
        //}

        //series2.MarkerStyle         = MarkerStyle.Circle;
        //series2.MarkerColor         = Color.FromArgb(0xFF, 0xAA, 0x20);
        //series2.MarkerBorderColor   = Color.FromArgb(0xD7, 0x41, 0x01);

        Font font  = new Font("Gulim", 11, FontStyle.Regular);
        Font font1 = new Font("Gulim", 10, FontStyle.Regular);

        Dundas.Charting.WebControl.Title title = DundasCharts.CreateTitle(chart
                                                                          , "Title1"
                                                                          , titleName
                                                                          , font
                                                                          , Color.FromArgb(26, 59, 105)
                                                                          , Color.Empty
                                                                          , Color.Empty
                                                                          , ContentAlignment.TopCenter
                                                                          , null
                                                                          , Color.FromArgb(32, 0, 0, 0)
                                                                          , 3
                                                                          , false
                                                                          , 5
                                                                          , 7
                                                                          , 91
                                                                          , 6);

        Legend legend = DundasCharts.CreateLegend(chart
                                                  , "Default"
                                                  , Color.Transparent
                                                  , Color.Empty
                                                  , Color.Empty);

        //legend.AutoFitText = true;
        //legend.Position = new ElementPosition(60, 7, 50, 24);

        legend.AutoFitText = false;
        legend.Position    = new ElementPosition(70, 2, 50, 25);
        legend.Font        = new Font("굴림", 7, FontStyle.Regular);

        DundasCharts.SetChartArea(chart.ChartAreas["Default"], false);
    }
Пример #6
0
    private void BindColumnChart(Chart chart
                                 , DataSet ds
                                 , string titleName
                                 , string name
                                 , string value)
    {
        DundasCharts.DundasChartBase(chart
                                     , ChartImageType.Flash
                                     , 240
                                     , 180
                                     , BorderSkinStyle.Emboss
                                     , Color.FromArgb(181, 64, 1)
                                     , 2
                                     , Color.FromArgb(0xFF, 0xFF, 0xFE)
                                     , Color.FromArgb(0xFF, 0xFF, 0xFE)
                                     , Color.FromArgb(0x20, 0x80, 0xD0)
                                     , ChartDashStyle.Solid
                                     , -1
                                     , ChartHatchStyle.None
                                     , GradientType.TopBottom
                                     , AntiAliasing.None);

        Series series = null;

        for (int k = 0; k < ds.Tables.Count; k++)
        {
            DataTable dt = ds.Tables[k];

            series = DundasCharts.CreateSeries(chart
                                               , "Series" + k.ToString()
                                               , "Default"
                                               , dt.TableName.Replace("사업부", "").Replace("법인", "")
                                               , dt.TableName.Replace("사업부", "").Replace("법인", "")
                                               , SeriesChartType.Column
                                               , 1
                                               , GetChartColor(k)
                                               , Color.FromArgb(0x4A, 0x58, 0x7E)
                                               , Color.FromArgb(64, 0, 0, 0)
                                               , 1
                                               , 9
                                               , Color.FromArgb(64, 64, 64));

            //series1.Label   = "#VALY{N0}";

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

            chart.ChartAreas["Default"].AxisY.LabelStyle.Format = "N0";

            DundasAnimations.DundasChartBase(chart, AnimationTheme.None, -1, -1, false, 1);
            DundasAnimations.GrowingAnimation(chart, series, 0.5, 1.5, true);

            //for (int i = 0; i < dt.Rows.Count; i++)
            //{
            //    series1.Points[i].AxisLabel = dt.Rows[i]["ALIAS"].ToString();
            //}

            //for (int i = 0; i < dt.Rows.Count; i++)
            //{
            //    series1.Points.AddY(dt.Rows[i]["RESULT_TS"]);
            //}

            series.Font = new Font("굴림", 7, FontStyle.Regular);

            if (k == 0)
            {
                //series.Points.AddXY("매출액", dt.Rows[0]["MS_SALES"]);
                //series.Points.AddXY("영업이익", dt.Rows[0]["MS_PROFIT"]);

                series.Points.AddXY(name, dt.Rows[0][value]);
            }
            else
            {
                //series.Points.AddY(dt.Rows[0]["MS_SALES"]);
                //series.Points.AddY(dt.Rows[0]["MS_PROFIT"]);

                series.Points.AddY(dt.Rows[0][value]);
            }
        }


        //series1.ToolTip = "#VALY{#,##0,00}";
        //series2.ToolTip = "#VALY{#,##0}";

        //series2.MarkerStyle         = MarkerStyle.Circle;
        //series2.MarkerColor         = Color.FromArgb(0xFF, 0xAA, 0x20);
        //series2.MarkerBorderColor   = Color.FromArgb(0xD7, 0x41, 0x01);

        Font font = new Font("Gulim", 11, FontStyle.Regular);

        Dundas.Charting.WebControl.Title title = DundasCharts.CreateTitle(chart
                                                                          , "Title1"
                                                                          , titleName
                                                                          , font
                                                                          , Color.FromArgb(26, 59, 105)
                                                                          , Color.Empty
                                                                          , Color.Empty
                                                                          , ContentAlignment.TopCenter
                                                                          , null
                                                                          , Color.FromArgb(32, 0, 0, 0)
                                                                          , 3
                                                                          , false
                                                                          , 5
                                                                          , 7
                                                                          , 91
                                                                          , 6);

        Legend legend = DundasCharts.CreateLegend(chart
                                                  , "Default"
                                                  , Color.Transparent
                                                  , Color.Empty
                                                  , Color.Empty);

        legend.AutoFitText = false;
        legend.Position    = new ElementPosition(73, 7, 50, 40);
        legend.Font        = new Font("굴림", 7, FontStyle.Regular);

        //legend.LegendStyle = LegendStyle.Table;
        //legend.AutoFitText = true;
        //legend.Docking = LegendDocking.Bottom;


        //legend.LegendStyle = LegendStyle.Table;
        //legend.AutoFitText = false;
        ////legend.Position = new ElementPosition(20, 100, 200, 40);
        //legend.Font = new Font("굴림", 7, FontStyle.Regular);
        //legend.Docking = LegendDocking.Bottom;

        DundasCharts.SetChartArea(chart.ChartAreas["Default"], false);
    }
Пример #7
0
    private void BindChart(Chart chart
                           , DataTable dtItem
                           , DataTable dtStock
                           , DataTable dtData
                           , string titleName)
    {
        DundasCharts.DundasChartBase(chart
                                     , ChartImageType.Flash
                                     , 480
                                     , 310
                                     , BorderSkinStyle.Emboss
                                     , Color.FromArgb(181, 64, 1)
                                     , 2
                                     , Color.FromArgb(0xFF, 0xFF, 0xFE)
                                     , Color.FromArgb(0xFF, 0xFF, 0xFE)
                                     , Color.FromArgb(0x20, 0x80, 0xD0)
                                     , ChartDashStyle.Solid
                                     , -1
                                     , ChartHatchStyle.None
                                     , GradientType.TopBottom
                                     , AntiAliasing.None);

        Series series1 = null;

        for (int k = 0; k < dtStock.Rows.Count; k++)
        {
            DataRow drS = dtStock.Rows[k];

            series1 = DundasCharts.CreateSeries(chart
                                                , "Series" + k.ToString()
                                                , "Default"
                                                , drS["S_NAME"].ToString()
                                                , null
                                                , SeriesChartType.StackedColumn
                                                , 1
                                                , GetChartColor(k)
                                                , Color.FromArgb(0x4A, 0x58, 0x7E)
                                                , Color.FromArgb(64, 0, 0, 0)
                                                , 1
                                                , 9
                                                , Color.FromArgb(64, 64, 64));

            //series1.Label   = "#VALY{N0}";

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

            //series1.ShowLabelAsValue = true;
            //series1.ShowInLegend = true;

            chart.ChartAreas["Default"].AxisY.LabelStyle.Format = "N0";

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

            series1.Font = new Font("굴림", 7, FontStyle.Regular);

            //for(int i = 0; i < dt.Rows.Count; i++)
            //{
            //    series1.Points.AddXY(dt.Rows[i]["ALIAS"].ToString(), dt.Rows[i]["TARGET_TS"]);
            //}

            //for(int i = 0; i < dt.Rows.Count; i++)
            //{
            //    series2.Points.AddY(dt.Rows[i]["RESULT_TS"]);
            //}

            DataTable dtData_1 = DataTypeUtility.FilterSortDataTable(dtData, string.Format("KPI_REF_ID > 0 AND STOCK_CODE = '{0}'", drS["S_ID"]));

            foreach (DataRow dr in dtData_1.Rows)
            {
                if (k == 0)
                {
                    series1.Points.AddXY(dr["I_NAME"].ToString(), dr["RESULT_TS"]);
                }
                else
                {
                    series1.Points.AddY(dr["RESULT_TS"]);
                }
            }

            //else
            //{
            //    series1.Points.AddY(dtData.Rows[k]["RESULT_TS"]);
            //    //series1.Points.AddY(dtData.Rows[k]["RESULT_TS"]);
            //}
        }

        //series1.ToolTip = "#VALY{#,##0,00}";
        //series2.ToolTip = "#VALY{#,##0}";

        //series2.MarkerStyle         = MarkerStyle.Circle;
        //series2.MarkerColor         = Color.FromArgb(0xFF, 0xAA, 0x20);
        //series2.MarkerBorderColor   = Color.FromArgb(0xD7, 0x41, 0x01);

        Font font = new Font("Gulim", 11, FontStyle.Regular);

        Dundas.Charting.WebControl.Title title = DundasCharts.CreateTitle(chart
                                                                          , "Title1"
                                                                          , titleName
                                                                          , font
                                                                          , Color.FromArgb(26, 59, 105)
                                                                          , Color.Empty
                                                                          , Color.Empty
                                                                          , ContentAlignment.TopCenter
                                                                          , null
                                                                          , Color.FromArgb(32, 0, 0, 0)
                                                                          , 3
                                                                          , false
                                                                          , 5
                                                                          , 7
                                                                          , 91
                                                                          , 6);

        Legend legend = DundasCharts.CreateLegend(chart
                                                  , "Default"
                                                  , Color.Transparent
                                                  , Color.Empty
                                                  , Color.Empty);
    }
Пример #8
0
    private void BindChart(Chart chart
                           , DataTable dt
                           , string titleName)
    {
        DundasCharts.DundasChartBase(chart
                                     , ChartImageType.Flash
                                     , 480
                                     , 160
                                     , BorderSkinStyle.Emboss
                                     , Color.FromArgb(181, 64, 1)
                                     , 2
                                     , Color.FromArgb(0xFF, 0xFF, 0xFE)
                                     , Color.FromArgb(0xFF, 0xFF, 0xFE)
                                     , Color.FromArgb(0x20, 0x80, 0xD0)
                                     , ChartDashStyle.Solid
                                     , -1
                                     , ChartHatchStyle.None
                                     , GradientType.TopBottom
                                     , AntiAliasing.None);

        Series series1 = DundasCharts.CreateSeries(chart
                                                   , "Series1"
                                                   , "Default"
                                                   , "당월미수금(누계)"
                                                   , null
                                                   , SeriesChartType.Column
                                                   , 1
                                                   , GetChartColor(0)
                                                   , Color.FromArgb(0x4A, 0x58, 0x7E)
                                                   , Color.FromArgb(64, 0, 0, 0)
                                                   , 1
                                                   , 9
                                                   , Color.FromArgb(64, 64, 64));

        Series series2 = DundasCharts.CreateSeries(chart
                                                   , "Series2"
                                                   , "Default"
                                                   , "당월수금금액"
                                                   , null
                                                   , SeriesChartType.Column
                                                   , 1
                                                   , GetChartColor(1)
                                                   , Color.FromArgb(0x4A, 0x58, 0x7E)
                                                   , Color.FromArgb(64, 0, 0, 0)
                                                   , 1
                                                   , 9
                                                   , Color.FromArgb(64, 64, 64));

        //series1.Label   = "#VALY{N0}";

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

        //series1.ShowLabelAsValue = true;
        //series1.ShowInLegend = true;

        chart.ChartAreas["Default"].AxisY.LabelStyle.Format = "N0";

        DundasAnimations.DundasChartBase(chart, AnimationTheme.None, -1, -1, false, 1);
        DundasAnimations.GrowingAnimation(chart, series1, 0.5, 1.5, true);
        DundasAnimations.GrowingAnimation(chart, series2, 0.5, 1.5, true);

        series1.Font = new Font("굴림", 7, FontStyle.Regular);
        series2.Font = new Font("굴림", 7, FontStyle.Regular);

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            series1.Points.AddXY(" ", dt.Rows[i]["TARGET_MS"]);
        }

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            series2.Points.AddY(dt.Rows[i]["RESULT_MS"]);
        }

        //DataTable dtData = DataTypeUtility.FilterSortDataTable(dt, "KPI_REF_ID > 0");

        //if(k == 0)
        //{
        //    series1.Points.AddXY("계획", dt.Rows[k]["TARGET_TS"]);
        //    series1.Points.AddXY("실적", dt.Rows[k]["RESULT_TS"]);
        //}
        //else
        //{
        //    series1.Points.AddY(dt.Rows[k]["TARGET_TS"]);
        //    series1.Points.AddY(dt.Rows[k]["RESULT_TS"]);
        //}

        //series1.ToolTip = "#VALY{#,##0,00}";
        //series2.ToolTip = "#VALY{#,##0}";

        //series2.MarkerStyle         = MarkerStyle.Circle;
        //series2.MarkerColor         = Color.FromArgb(0xFF, 0xAA, 0x20);
        //series2.MarkerBorderColor   = Color.FromArgb(0xD7, 0x41, 0x01);

        Font font = new Font("Gulim", 10, FontStyle.Regular);

        Dundas.Charting.WebControl.Title title = DundasCharts.CreateTitle(chart
                                                                          , "Title1"
                                                                          , titleName
                                                                          , font
                                                                          , Color.FromArgb(26, 59, 105)
                                                                          , Color.Empty
                                                                          , Color.Empty
                                                                          , ContentAlignment.TopCenter
                                                                          , null
                                                                          , Color.FromArgb(32, 0, 0, 0)
                                                                          , 3
                                                                          , false
                                                                          , 5
                                                                          , 7
                                                                          , 91
                                                                          , 6);

        Legend legend = DundasCharts.CreateLegend(chart
                                                  , "Default"
                                                  , Color.Transparent
                                                  , Color.Empty
                                                  , Color.Empty);



        //DataRow[] drCol = dt.Select(string.Format("KPI_REF_ID < 0"));

        //DundasCharts.SetChartArea(chart.ChartAreas["Default"], false);

        //if(drCol.Length > 0)
        //{
        //    lbl.Text = DataTypeUtility.GetToDouble(drCol[0]["RNF_RATE"]).ToString("#,##0.00") + "%";
        //}
        //else
        //{
        //    lbl.Text = "0" + "%";
        //}
    }
Пример #9
0
    private void BindChart(Chart chart
                           , DataTable dt
                           , string titleName)
    {
        DundasCharts.DundasChartBase(chart
                                     , ChartImageType.Flash
                                     , 480
                                     , 150
                                     , BorderSkinStyle.Emboss
                                     , Color.FromArgb(181, 64, 1)
                                     , 2
                                     , Color.FromArgb(0xFF, 0xFF, 0xFE)
                                     , Color.FromArgb(0xFF, 0xFF, 0xFE)
                                     , Color.FromArgb(0x20, 0x80, 0xD0)
                                     , ChartDashStyle.Solid
                                     , -1
                                     , ChartHatchStyle.None
                                     , GradientType.TopBottom
                                     , AntiAliasing.None);

        Series series1 = DundasCharts.CreateSeries(chart
                                                   , "Series1"
                                                   , "Default"
                                                   , "매출액"
                                                   , null
                                                   , SeriesChartType.Column
                                                   , 1
                                                   , GetChartColor(0)
                                                   , Color.FromArgb(0x4A, 0x58, 0x7E)
                                                   , Color.FromArgb(64, 0, 0, 0)
                                                   , 1
                                                   , 9
                                                   , Color.FromArgb(64, 64, 64));

        Series series2 = DundasCharts.CreateSeries(chart
                                                   , "Series2"
                                                   , "Default"
                                                   , "영업이익"
                                                   , null
                                                   , SeriesChartType.Column
                                                   , 1
                                                   , GetChartColor(1)
                                                   , Color.FromArgb(0x4A, 0x58, 0x7E)
                                                   , Color.FromArgb(64, 0, 0, 0)
                                                   , 1
                                                   , 9
                                                   , Color.FromArgb(64, 64, 64));

        //series1.Label   = "#VALY{N0}";

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

        //series1.ShowLabelAsValue = true;
        //series1.ShowInLegend = true;

        chart.ChartAreas["Default"].AxisY.LabelStyle.Format = "N0";

        DundasAnimations.DundasChartBase(chart, AnimationTheme.None, -1, -1, false, 1);
        DundasAnimations.GrowingAnimation(chart, series1, 0.5, 1.5, true);
        DundasAnimations.GrowingAnimation(chart, series2, 0.5, 1.5, true);

        //for (int i = 0; i < dt.Rows.Count; i++)
        //{
        //    series1.Points[i].AxisLabel = dt.Rows[i]["ALIAS"].ToString();
        //}

        //for (int i = 0; i < dt.Rows.Count; i++)
        //{
        //    series1.Points.AddY(dt.Rows[i]["RESULT_TS"]);
        //}

        series1.Font = new Font("굴림", 7, FontStyle.Regular);
        series2.Font = new Font("굴림", 7, FontStyle.Regular);

        if (dt.Rows.Count > 0)
        {
            series1.Points.AddXY("당월", dt.Rows[0]["RESULT_MS"]);
            series1.Points.AddXY("누계", dt.Rows[0]["RESULT_TS"]);
            series1.Points.AddXY("전년동기실적", dt.Rows[0]["BF_RESULT_TS"]);

            series2.Points.AddY(dt.Rows[1]["RESULT_MS"]);
            series2.Points.AddY(dt.Rows[1]["RESULT_TS"]);
            series2.Points.AddY(dt.Rows[1]["BF_RESULT_TS"]);
        }

        //series1.ToolTip = "#VALY{#,##0,00}";
        //series2.ToolTip = "#VALY{#,##0}";

        //series2.MarkerStyle         = MarkerStyle.Circle;
        //series2.MarkerColor         = Color.FromArgb(0xFF, 0xAA, 0x20);
        //series2.MarkerBorderColor   = Color.FromArgb(0xD7, 0x41, 0x01);

        Font font = new Font("Gulim", 11, FontStyle.Regular);

        Dundas.Charting.WebControl.Title title = DundasCharts.CreateTitle(chart
                                                                          , "Title1"
                                                                          , titleName
                                                                          , font
                                                                          , Color.FromArgb(26, 59, 105)
                                                                          , Color.Empty
                                                                          , Color.Empty
                                                                          , ContentAlignment.TopCenter
                                                                          , null
                                                                          , Color.FromArgb(32, 0, 0, 0)
                                                                          , 3
                                                                          , false
                                                                          , 5
                                                                          , 7
                                                                          , 91
                                                                          , 6);

        Legend legend = DundasCharts.CreateLegend(chart
                                                  , "Default"
                                                  , Color.Transparent
                                                  , Color.Empty
                                                  , Color.Empty);

        DundasCharts.SetChartArea(chart.ChartAreas["Default"], false);
    }
Пример #10
0
    private void BindingPieChart(string yearStr)
    {
        DataRow   drNew     = null;
        DataTable dataTable = new DataTable();
        DataTable dtTable   = GetDTChart("전체");

        DataRow[] draDefault = null;
        DataTable dtItems    = GetDTItems("");

        draDefault = dtTable.Select(
            "YMD='" + GetLastDay() + "'"
            );

        if (draDefault.Length == 0)
        {
            dataTable.Columns.Add("Gubun", typeof(string));
            dataTable.Columns.Add("카프로락탐", typeof(double));
            dataTable.Columns.Add("박편락탐", typeof(double));
            dataTable.Columns.Add("유안벌크", typeof(double));
            dataTable.Columns.Add("싸이크로헥산", typeof(double));
            dataTable.Columns.Add("아논", typeof(double));

            drNew           = dataTable.NewRow();
            drNew["Gubun"]  = ddlGong.SelectedItem.Text;
            drNew["카프로락탐"]  = 0;
            drNew["박편락탐"]   = 0;
            drNew["유안벌크"]   = 0;
            drNew["싸이크로헥산"] = 0;
            drNew["아논"]     = 0;
            dataTable.Rows.Add(drNew);
            Chart5.DataSource = dataTable;

            DundasCharts.DundasChartBase(Chart5, ChartImageType.Flash, 800, 235
                                         , BorderSkinStyle.Emboss, Color.FromArgb(181, 64, 1), 2
                                         , Color.FromArgb(0xFF, 0xFF, 0xFE)
                                         , Color.FromArgb(0xFF, 0xFF, 0xFE), Color.FromArgb(0x20, 0x80, 0xD0), ChartDashStyle.Solid
                                         , -1
                                         , ChartHatchStyle.None, GradientType.TopBottom, AntiAliasing.None);

            Series srSeries1 = DundasCharts.CreateSeries(Chart5, "", "Default", "카프로락탐", null, SeriesChartType.Column, 1, GetChartColor(0), GetChartColor(0), Color.FromArgb(64, 0, 0, 0), 1, 9, Color.FromArgb(64, 64, 64));
            srSeries1.ValueMembersY = "카프로락탐";
            DundasAnimations.GrowingAnimation(Chart5, srSeries1, 0, 0 + 1, true);
            srSeries1.ShowLabelAsValue = true;
            srSeries1.ToolTip          = "#VALY{N0}";
            srSeries1.LabelFormat      = "N0";

            Series srSeries2 = DundasCharts.CreateSeries(Chart5, "", "Default", "박편락탐", null, SeriesChartType.Column, 1, GetChartColor(1), GetChartColor(1), Color.FromArgb(64, 0, 0, 0), 1, 9, Color.FromArgb(64, 64, 64));
            srSeries2.ValueMembersY = "박편락탐";
            DundasAnimations.GrowingAnimation(Chart5, srSeries2, 1, 1 + 1, true);
            srSeries2.ShowLabelAsValue = true;
            srSeries2.ToolTip          = "#VALY{N0}";
            srSeries2.LabelFormat      = "N0";

            Series srSeries3 = DundasCharts.CreateSeries(Chart5, "", "Default", "유안벌크", null, SeriesChartType.Column, 1, GetChartColor(2), GetChartColor(2), Color.FromArgb(64, 0, 0, 0), 1, 9, Color.FromArgb(64, 64, 64));
            srSeries3.ValueMembersY = "유안벌크";
            DundasAnimations.GrowingAnimation(Chart5, srSeries3, 2, 2 + 1, true);
            srSeries3.ShowLabelAsValue = true;
            srSeries3.ToolTip          = "#VALY{N0}";
            srSeries3.LabelFormat      = "N0";

            Series srSeries4 = DundasCharts.CreateSeries(Chart5, "", "Default", "싸이크로헥산", null, SeriesChartType.Column, 1, GetChartColor(3), GetChartColor(3), Color.FromArgb(64, 0, 0, 0), 1, 9, Color.FromArgb(64, 64, 64));
            srSeries4.ValueMembersY = "싸이크로헥산";
            DundasAnimations.GrowingAnimation(Chart5, srSeries4, 3, 3 + 1, true);
            srSeries4.ShowLabelAsValue = true;
            srSeries4.ToolTip          = "#VALY{N0}";
            srSeries4.LabelFormat      = "N0";

            Series srSeries5 = DundasCharts.CreateSeries(Chart5, "", "Default", "아논", null, SeriesChartType.Column, 1, GetChartColor(4), GetChartColor(4), Color.FromArgb(64, 0, 0, 0), 1, 9, Color.FromArgb(64, 64, 64));
            srSeries5.ValueMembersY = "아논";
            DundasAnimations.GrowingAnimation(Chart5, srSeries5, 4, 4 + 1, true);
            srSeries5.ShowLabelAsValue = true;
            srSeries5.ToolTip          = "#VALY{N0}";
            srSeries5.LabelFormat      = "N0";

            srSeries3.ValueMemberX          = "Gubun";
            srSeries3.YAxisType             = AxisType.Secondary;
            Chart5.Legends[0].Position.Auto = true;

            string sChartArea = Chart5.Series[srSeries1.Name].ChartArea;
            Chart5.ChartAreas[sChartArea].AxisY.LabelStyle.Format  = "N0";
            Chart5.ChartAreas[sChartArea].AxisY2.LabelStyle.Format = "N0";

            Font   font1  = new Font("Gulim", 9, FontStyle.Regular);
            Legend legend = DundasCharts.CreateLegend(Chart5, "Default", Color.Transparent, Color.Empty, Color.Empty, font1, true, -1, -1, -1, -1);

            SetVisibleZeroPoint(Chart5, Convert.ToInt32(PageUtility.GetByValueDropDownList(ddlYear)));
            return;
        }

        if (dtTable.Columns.Count != 2)
        {
            dataTable.Columns.Add("Gubun", typeof(string));
            for (int i = 1; i < dtTable.Columns.Count; i++)
            {
                dataTable.Columns.Add(dtTable.Columns[i].ColumnName, typeof(double));
            }
            drNew          = dataTable.NewRow();
            drNew["Gubun"] = ddlGong.SelectedItem.Text;


            for (int i = 1; i < dtTable.Columns.Count; i++)
            {
                drNew[i] = Math.Round(Convert.ToDouble(draDefault[0][i]), 0);
            }

            dataTable.Rows.Add(drNew);


            Chart5.DataSource = dataTable;

            DundasCharts.DundasChartBase(Chart5, ChartImageType.Flash, 800, 235
                                         , BorderSkinStyle.Emboss, Color.FromArgb(181, 64, 1), 2
                                         , Color.FromArgb(0xFF, 0xFF, 0xFE)
                                         , Color.FromArgb(0xFF, 0xFF, 0xFE), Color.FromArgb(0x20, 0x80, 0xD0), ChartDashStyle.Solid
                                         , -1
                                         , ChartHatchStyle.None, GradientType.TopBottom, AntiAliasing.None);


            Series srSeries1 = DundasCharts.CreateSeries(Chart5, "", "Default", "카프로락탐", null, SeriesChartType.Column, 1, GetChartColor(0), GetChartColor(0), Color.FromArgb(64, 0, 0, 0), 1, 9, Color.FromArgb(64, 64, 64));
            srSeries1.ValueMembersY = "카프로락탐";
            DundasAnimations.GrowingAnimation(Chart5, srSeries1, 0, 0 + 1, true);
            srSeries1.ShowLabelAsValue = true;
            srSeries1.ToolTip          = "#VALY{N0}";
            srSeries1.LabelFormat      = "N0";

            Series srSeries2 = DundasCharts.CreateSeries(Chart5, "", "Default", "박편락탐", null, SeriesChartType.Column, 1, GetChartColor(1), GetChartColor(1), Color.FromArgb(64, 0, 0, 0), 1, 9, Color.FromArgb(64, 64, 64));
            srSeries2.ValueMembersY = "박편락탐";
            DundasAnimations.GrowingAnimation(Chart5, srSeries2, 1, 1 + 1, true);
            srSeries2.ShowLabelAsValue = true;
            srSeries2.ToolTip          = "#VALY{N0}";
            srSeries2.LabelFormat      = "N0";

            Series srSeries3 = DundasCharts.CreateSeries(Chart5, "", "Default", "유안벌크", null, SeriesChartType.Column, 1, GetChartColor(2), GetChartColor(2), Color.FromArgb(64, 0, 0, 0), 1, 9, Color.FromArgb(64, 64, 64));
            srSeries3.ValueMembersY = "유안벌크";
            DundasAnimations.GrowingAnimation(Chart5, srSeries3, 2, 2 + 1, true);
            srSeries3.ShowLabelAsValue = true;
            srSeries3.ToolTip          = "#VALY{N0}";
            srSeries3.LabelFormat      = "N0";

            Series srSeries4 = DundasCharts.CreateSeries(Chart5, "", "Default", "싸이크로헥산", null, SeriesChartType.Column, 1, GetChartColor(3), GetChartColor(3), Color.FromArgb(64, 0, 0, 0), 1, 9, Color.FromArgb(64, 64, 64));
            srSeries4.ValueMembersY = "싸이크로헥산";
            DundasAnimations.GrowingAnimation(Chart5, srSeries4, 3, 3 + 1, true);
            srSeries4.ShowLabelAsValue = true;
            srSeries4.ToolTip          = "#VALY{N0}";
            srSeries4.LabelFormat      = "N0";

            Series srSeries5 = DundasCharts.CreateSeries(Chart5, "", "Default", "아논", null, SeriesChartType.Column, 1, GetChartColor(4), GetChartColor(4), Color.FromArgb(64, 0, 0, 0), 1, 9, Color.FromArgb(64, 64, 64));
            srSeries5.ValueMembersY = "아논";
            DundasAnimations.GrowingAnimation(Chart5, srSeries5, 4, 4 + 1, true);
            srSeries5.ShowLabelAsValue = true;
            srSeries5.ToolTip          = "#VALY{N0}";
            srSeries5.LabelFormat      = "N0";

            srSeries3.ValueMemberX          = "Gubun";
            srSeries3.YAxisType             = AxisType.Secondary;
            Chart5.Legends[0].Position.Auto = true;

            string sChartArea = Chart5.Series[srSeries1.Name].ChartArea;
            Chart5.ChartAreas[sChartArea].AxisY.LabelStyle.Format  = "N0";
            Chart5.ChartAreas[sChartArea].AxisY2.LabelStyle.Format = "N0";

            Font   font1  = new Font("Gulim", 9, FontStyle.Regular);
            Legend legend = DundasCharts.CreateLegend(Chart5, "Default", Color.Transparent, Color.Empty, Color.Empty, font1, true, -1, -1, -1, -1);
        }
        else
        {
            dataTable.Columns.Add("Gubun", typeof(string));
            for (int i = 1; i < dtTable.Columns.Count; i++)
            {
                dataTable.Columns.Add(dtTable.Columns[i].ColumnName, typeof(double));
            }
            drNew          = dataTable.NewRow();
            drNew["Gubun"] = ddlGong.SelectedItem.Text;


            for (int i = 1; i < dtTable.Columns.Count; i++)
            {
                drNew[i] = Math.Round(Convert.ToDouble(draDefault[0][i]), 0);
            }

            dataTable.Rows.Add(drNew);


            Chart5.DataSource = dataTable;

            DundasCharts.DundasChartBase(Chart5, ChartImageType.Flash, 800, 235
                                         , BorderSkinStyle.Emboss, Color.FromArgb(181, 64, 1), 2
                                         , Color.FromArgb(0xFF, 0xFF, 0xFE)
                                         , Color.FromArgb(0xFF, 0xFF, 0xFE), Color.FromArgb(0x20, 0x80, 0xD0), ChartDashStyle.Solid
                                         , -1
                                         , ChartHatchStyle.None, GradientType.TopBottom, AntiAliasing.None);

            Series srSeries5 = DundasCharts.CreateSeries(Chart5, "", "Default", dtTable.Columns[1].ColumnName, null, SeriesChartType.Column, 1, GetChartColor(GetChartInfo(dtTable.Columns[1].ColumnName)), GetChartColor(GetChartInfo(dtTable.Columns[1].ColumnName)), Color.FromArgb(64, 0, 0, 0), 1, 9, Color.FromArgb(64, 64, 64));
            srSeries5.ValueMembersY = dtTable.Columns[1].ColumnName;
            DundasAnimations.GrowingAnimation(Chart5, srSeries5, 2, 2 + 1, true);
            srSeries5.ShowLabelAsValue = true;
            srSeries5.ToolTip          = "#VALY{N0}";
            srSeries5.LabelFormat      = "N0";

            srSeries5.ValueMemberX = "Gubun";
            if (dtTable.Columns[1].ColumnName == "유안벌크")
            {
                srSeries5.YAxisType = AxisType.Secondary;
            }
            Chart5.Legends[0].Position.Auto = true;

            string sChartArea = Chart5.Series[srSeries5.Name].ChartArea;
            Chart5.ChartAreas[sChartArea].AxisY.LabelStyle.Format  = "N0";
            Chart5.ChartAreas[sChartArea].AxisY2.LabelStyle.Format = "N0";

            Font   font1  = new Font("Gulim", 9, FontStyle.Regular);
            Legend legend = DundasCharts.CreateLegend(Chart5, "Default", Color.Transparent, Color.Empty, Color.Empty, font1, true, -1, -1, -1, -1);
        }

        SetVisibleZeroPoint(Chart5, Convert.ToInt32(PageUtility.GetByValueDropDownList(ddlYear)));
    }
Пример #11
0
    private void BindChart(Chart chart
                           , DataTable dt
                           , string titleName
                           , System.Web.UI.WebControls.Label lbl1
                           , System.Web.UI.WebControls.Label lbl2
                           , System.Web.UI.WebControls.Label lbl3)
    {
        DundasCharts.DundasChartBase(chart
                                     , ChartImageType.Flash
                                     , 480
                                     , 220
                                     , BorderSkinStyle.Emboss
                                     , Color.FromArgb(181, 64, 1)
                                     , 2
                                     , Color.FromArgb(0xFF, 0xFF, 0xFE)
                                     , Color.FromArgb(0xFF, 0xFF, 0xFE)
                                     , Color.FromArgb(0x20, 0x80, 0xD0)
                                     , ChartDashStyle.Solid
                                     , -1
                                     , ChartHatchStyle.None
                                     , GradientType.TopBottom
                                     , AntiAliasing.None);

        Series series1 = null;

        for (int k = 0; k < dt.Rows.Count; k++)
        {
            if (DataTypeUtility.GetToInt32(dt.Rows[k]["KPI_REF_ID"]) < 0)
            {
                continue;
            }

            series1 = DundasCharts.CreateSeries(chart
                                                , "Series" + k.ToString()
                                                , "Default"
                                                , dt.Rows[k]["ALIAS"].ToString()
                                                , null
                                                , SeriesChartType.StackedColumn
                                                , 1
                                                , GetChartColor(k)
                                                , Color.FromArgb(0x4A, 0x58, 0x7E)
                                                , Color.FromArgb(64, 0, 0, 0)
                                                , 1
                                                , 9
                                                , Color.FromArgb(64, 64, 64));

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

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

            //series1.ShowLabelAsValue = true;
            //series1.ShowInLegend = true;

            chart.ChartAreas["Default"].AxisY.LabelStyle.Format = "N0";

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

            series1.Font = new Font("굴림", 7, FontStyle.Regular);

            DataTable dtData = DataTypeUtility.FilterSortDataTable(dt, "KPI_REF_ID > 0");

            if (k == 0)
            {
                series1.Points.AddXY("계획", dt.Rows[k]["TARGET_TS"]);
                series1.Points.AddXY("실적", dt.Rows[k]["RESULT_TS"]);
            }
            else
            {
                series1.Points.AddY(dt.Rows[k]["TARGET_TS"]);
                series1.Points.AddY(dt.Rows[k]["RESULT_TS"]);
            }

            //series1.ToolTip = "#VALY{#,##0,00}";
            //series2.ToolTip = "#VALY{#,##0}";
        }

        //series2.MarkerStyle         = MarkerStyle.Circle;
        //series2.MarkerColor         = Color.FromArgb(0xFF, 0xAA, 0x20);
        //series2.MarkerBorderColor   = Color.FromArgb(0xD7, 0x41, 0x01);

        Font font = new Font("Gulim", 11, FontStyle.Regular);

        Dundas.Charting.WebControl.Title title = DundasCharts.CreateTitle(chart
                                                                          , "Title1"
                                                                          , titleName
                                                                          , font
                                                                          , Color.FromArgb(26, 59, 105)
                                                                          , Color.Empty
                                                                          , Color.Empty
                                                                          , ContentAlignment.TopCenter
                                                                          , null
                                                                          , Color.FromArgb(32, 0, 0, 0)
                                                                          , 3
                                                                          , false
                                                                          , 5
                                                                          , 7
                                                                          , 91
                                                                          , 6);

        Legend legend = DundasCharts.CreateLegend(chart
                                                  , "Default"
                                                  , Color.Transparent
                                                  , Color.Empty
                                                  , Color.Empty);

        legend.AutoFitText = false;
        legend.Position    = new ElementPosition(80, 7, 50, 20);
        legend.Font        = new Font("굴림", 7, FontStyle.Regular);

        DataRow[] drCol = dt.Select(string.Format("KPI_REF_ID < 0"));

        DundasCharts.SetChartArea(chart.ChartAreas["Default"], false);

        if (drCol.Length > 0)
        {
            lbl1.Text = DataTypeUtility.GetToDouble(drCol[0]["RNF_RATE"]).ToString("#,##0.00") + "%";
        }
        else
        {
            lbl1.Text = "0" + "%";
        }

        drCol = dt.Select(string.Format("KPI_REF_ID < 0"));

        DundasCharts.SetChartArea(chart.ChartAreas["Default"], false);

        if (drCol.Length > 0)
        {
            lbl2.Text = DataTypeUtility.GetToDouble(drCol[0]["TARGET_TS"]).ToString("#,##0") + "";
            lbl3.Text = DataTypeUtility.GetToDouble(drCol[0]["RESULT_TS"]).ToString("#,##0") + "";
        }
        else
        {
            lbl2.Text = "0" + "";
            lbl3.Text = "0" + "";
        }
    }