Exemplo n.º 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);
    }
Exemplo n.º 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);
    }
Exemplo n.º 3
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";
        }
    }
Exemplo n.º 4
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);
    }
Exemplo n.º 5
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);
    }
Exemplo n.º 6
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);
    }
Exemplo n.º 7
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" + "";
        }
    }
Exemplo n.º 8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        type = (Request["type"] != null && !Request["type"].Equals("")) ? int.Parse(Request["type"].ToString()) : 2;
        string query = "SELECT splyy as tmcode , sum(splddqty) as target , sum(sumddqty) as result FROM uz5plan WHERE saupjang=21 group by splyy";

        DundasCharts.DundasChartBase(Chart1, ChartImageType.Flash, 400, 250, BorderSkinStyle.None, Color.FromArgb(181, 64, 1), 5
                                     , Color.FromArgb(0xE0, 0xF0, 0xFF), Color.FromArgb(0xF0, 0xC0, 0xFF), Color.FromArgb(210, 210, 210), ChartDashStyle.Solid, 2
                                     , ChartHatchStyle.None, GradientType.TopBottom, AntiAliasing.None);
        DundasCharts.DundasChartBase(Chart2, ChartImageType.Flash, 400, 250, BorderSkinStyle.None, Color.FromArgb(181, 64, 1), 5
                                     , Color.FromArgb(0xE0, 0xF0, 0xFF), Color.FromArgb(0xF0, 0xC0, 0xFF), Color.FromArgb(210, 210, 210), ChartDashStyle.Solid, 2
                                     , ChartHatchStyle.None, GradientType.TopBottom, AntiAliasing.None);

        string          ctTitle = "Line Chart";
        SeriesChartType DataCT;

        switch (type)
        {
        case 1:
            DataCT  = SeriesChartType.Bar;
            ctTitle = "Bar Chart";
            break;

        case 2:
            DataCT  = SeriesChartType.Line;
            ctTitle = "Line Chart";
            break;

        case 3:
            DataCT  = SeriesChartType.CandleStick;
            ctTitle = "CandleStick Chart";
            break;

        case 4:
            DataCT  = SeriesChartType.StackedBar;
            ctTitle = "StackedBar Chart";
            break;

        case 5:
            DataCT  = SeriesChartType.Spline;
            ctTitle = "Spline Chart";
            break;

        case 6:
            DataCT  = SeriesChartType.SplineArea;
            ctTitle = "SplineArea Chart";
            break;

        case 7:
            DataCT  = SeriesChartType.Range;
            ctTitle = "Range Chart";
            break;

        case 8:
            DataCT  = SeriesChartType.RangeColumn;
            ctTitle = "RangeColumn Chart";
            break;

        case 9:
            DataCT  = SeriesChartType.Point;
            ctTitle = "Point Chart";
            break;

        case 10:
            DataCT  = SeriesChartType.Gantt;
            ctTitle = "Gantt Chart";
            break;

        case 11:
            DataCT  = SeriesChartType.StepLine;
            ctTitle = "StepLine Chart";
            break;

        default:
            DataCT  = SeriesChartType.Radar;
            ctTitle = "Radar Chart";
            break;
        }

        Series series1 = DundasCharts.CreateSeries(Chart1, "Series1", "Default", "계획", null, DataCT, 2, Color.FromArgb(220, 65, 140, 240), Color.FromArgb(180, 26, 59, 105), Color.FromArgb(64, 0, 0, 0), 1, 9, Color.FromArgb(64, 64, 64));
        Series series2 = DundasCharts.CreateSeries(Chart1, "Series2", "Default", "실적", null, DataCT, 2, Color.FromArgb(220, 252, 180, 65), Color.FromArgb(180, 26, 59, 105), Color.FromArgb(64, 0, 0, 0), 1, 9, Color.FromArgb(64, 64, 64));

        Series series3 = DundasCharts.CreateSeries(Chart2, "Series1", "Default", "계획", null, DataCT, 2, Color.FromArgb(220, 65, 140, 240), Color.FromArgb(180, 26, 59, 105), Color.FromArgb(64, 0, 0, 0), 1, 9, Color.FromArgb(64, 64, 64));
        Series series4 = DundasCharts.CreateSeries(Chart2, "Series2", "Default", "실적", null, DataCT, 2, Color.FromArgb(220, 252, 180, 65), Color.FromArgb(180, 26, 59, 105), Color.FromArgb(64, 0, 0, 0), 1, 9, Color.FromArgb(64, 64, 64));

        ArrayList yValues1;
        ArrayList yValues2;
        ArrayList xValues;

        DundasCharts.SetDataFieldsX1(query, "tmcode", out xValues, "target", out yValues1, "result", out yValues2);

        series1.Points.DataBindXY(xValues, yValues1);
        series2.Points.DataBindXY(xValues, yValues2);

        //DundasAnimations.DundasChartBase(Chart1, AnimationTheme.None, -1, -1, true, 1);

        //DundasAnimations.GrowingAnimation(Chart1, series1, 0.0, 3.0, false);
        //DundasAnimations.GrowingAnimation(Chart1, series2, 3.0, 4.0, true);

        DataPoint point = series1.Points.FindMaxValue();

        point.Color = Color.Fuchsia;

        for (int i = 0; i < series2.Points.Count; i++)
        {
            //series2.Points[i].ShowLabelAsValue = true;

            if (yValues2[i].ToString() == "0")
            {
                series2.Points[i].Color = Color.Transparent;
            }
        }

        DundasAnimations.FadingAnimation(Chart1, point, Color.BlueViolet, Color.FromArgb(64, 64, 64), Color.Empty, Color.Empty, Color.Empty, 7.0, 1.0, true, true, -1);

        DundasAnimations.FadingAnimation(Chart2, point, Color.BlueViolet, Color.FromArgb(64, 64, 64), Color.Empty, Color.Empty, Color.Empty, 7.0, 1.0, true, true, -1);
        // Set radar chart style Line, Area, Marker
        series1["RadarDrawingStyle"] = "Line";
        series2["RadarDrawingStyle"] = "Line";

        // Set circular area drawing style //Circle, Polygon
        series1["AreaDrawingStyle"] = "Polygon";
        series2["AreaDrawingStyle"] = "Polygon";

        // Set labels style //Horizontal, Circular, Radial
        series1["CircularLabelsStyle"] = "Horizontal";
        series2["CircularLabelsStyle"] = "Horizontal";

        Font font  = new Font("Tahoma", 14, FontStyle.Regular);
        Font font1 = new Font("Gulim", 9, FontStyle.Regular);

        /*
         * Dundas.Charting.WebControl.Title title = DundasCharts.CreateTitle(Chart1, "Title1", ctTitle, font, Color.FromArgb(26, 59, 105), Color.Empty, Color.Empty
         *  , ContentAlignment.TopCenter, null, Color.FromArgb(32, 0, 0, 0), 3, false, 5, 5, 91, 6);
         *
         * Dundas.Charting.WebControl.Title title2 = DundasCharts.CreateTitle(Chart2, "Title1", ctTitle, font, Color.FromArgb(26, 59, 105), Color.Empty, Color.Empty
         *  , ContentAlignment.TopCenter, null, Color.FromArgb(32, 0, 0, 0), 3, false, 5, 5, 91, 6);
         */
        //Legend legend = DundasCharts.CreateLegend(Chart1, "Default", Color.Transparent, Color.Empty, Color.Empty, font1, true, 75, 75, 20, 15);

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

        query  = " SELECT a.saupjang, a.splyy, a.splmm, a.spldd, a.splddqty, a.splmmqty,";
        query += " a.splyyqty, a.sumddqty, a.summmqty, a.sumyyqty, a.modempno, a.modymdt";
        query += " FROM uz5plan a";
        query += " where a.splyy = 2006 order by saupjang, splyy, splmm";
        DataSet          ds          = new DataSet();
        OracleConnection _connection = new OracleConnection();

        _connection.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["MainDB_Oracle"].ConnectionString;
        OracleDataAdapter ad = new OracleDataAdapter(query, _connection);

        ad.Fill(ds);

        UltraWebGrid1.DataSource = ds;
        UltraWebGrid1.DataBind();
    }