示例#1
0
        private void BindingChartRejectRslt(DataTable _dtChartData)
        {
            try
            {
                if (this.pieDiagramRsltMain.Series.Count > 0)
                {
                    this.pieDiagramRsltMain.Series.Clear();
                }
                this.chartErrPrctPie.BeginInit();

                // 차트 색 지정 (색상 수 : 7개)
                CustomPalette customPalette = new CustomPalette();
                customPalette.Colors.Add(Colors.LightBlue);
                customPalette.Colors.Add(Colors.IndianRed);
                customPalette.Colors.Add(Colors.SteelBlue);
                customPalette.Colors.Add(Colors.Orange);
                customPalette.Colors.Add(Colors.OliveDrab);
                customPalette.Colors.Add(Colors.PapayaWhip);
                customPalette.Colors.Add(Colors.LightCoral);

                chartErrPrctPie.Palette = customPalette;

                this.g_Is3D = new PieSeries3D();
                this.g_Is3D.ArgumentScaleType  = ScaleType.Auto;
                this.g_Is3D.DataSourceSorted   = false;
                this.g_Is3D.ArgumentDataMember = "Argument_str";
                this.g_Is3D.ValueDataMember    = "Value";

                List <ChartDataPointMember> pies = this.GetGenerateDataCell(_dtChartData);
                this.g_Is3D.DataSource = pies;

                this.g_Is3D.LegendTextPattern = "{S} : {A:0}";

                if (this.pieDiagramRsltMain.Series.Count > 0)
                {
                    this.pieDiagramRsltMain.Series.Clear();
                }
                this.pieDiagramRsltMain.Series.Add(this.g_Is3D);

                // 파이차트 마우스 회전 X
                this.pieDiagramRsltMain.RuntimeRotation = false;

                // 파이차트 Label
                this.g_Is3D.LabelsVisibility  = true;
                this.g_Is3D.Label             = new SeriesLabel();
                this.g_Is3D.Label.TextPattern = "{A}: {VP:P0}";
                PieSeries3D.SetLabelPosition(this.g_Is3D.Label, PieLabelPosition.TwoColumns);
            }
            catch { throw; }
            finally
            {
                this.chartErrPrctPie.EndInit();
                this.g_Is3D = null;
            }
        }